mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-16 12:58:48 +08:00
edit/lscolors: Skip symlink test if creation failed.
This commit is contained in:
parent
fd228af87c
commit
2f4239d49e
|
@ -28,12 +28,20 @@ func TestDetermineFeature(t *testing.T) {
|
|||
test("a", true, featureRegular)
|
||||
|
||||
// Symlink.
|
||||
os.Symlink("a", "symlink")
|
||||
test("symlink", true, featureSymlink)
|
||||
err := os.Symlink("a", "symlink")
|
||||
if err != nil {
|
||||
t.Logf("Failed to create symlink: %v; skipping symlink test", err)
|
||||
} else {
|
||||
test("symlink", true, featureSymlink)
|
||||
}
|
||||
|
||||
// Broken symlink.
|
||||
os.Symlink("aaaa", "bad-symlink")
|
||||
test("bad-symlink", true, featureOrphanedSymlink)
|
||||
err = os.Symlink("aaaa", "bad-symlink")
|
||||
if err != nil {
|
||||
t.Logf("Failed to create bad symlink: %v; skipping bad symlink test", err)
|
||||
} else {
|
||||
test("bad-symlink", true, featureOrphanedSymlink)
|
||||
}
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
// Multiple hard links.
|
||||
|
|
Loading…
Reference in New Issue
Block a user