From 70a64db6bca2aaa5cfee4d50d582d575be21d5fe Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Wed, 29 Sep 2021 18:10:56 +0200 Subject: catch all symlink test errors --- repo_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/repo_test.go b/repo_test.go index 3885e0b..63a1184 100644 --- a/repo_test.go +++ b/repo_test.go @@ -188,9 +188,15 @@ func TestSymlinks(t *testing.T) { if err = f.Close(); err != nil { t.Fatal(err) } - os.Symlink(extDir, filepath.Join(tmpDir, "linkexternal")) - os.Symlink("./notexisting", filepath.Join(tmpDir, "linknotexisting")) - os.Symlink("./existing", filepath.Join(tmpDir, "linkexisting")) + if err = os.Symlink(extDir, filepath.Join(tmpDir, "linkexternal")); err != nil { + t.Fatal(err) + } + if err = os.Symlink("./notexisting", filepath.Join(tmpDir, "linknotexisting")); err != nil { + t.Fatal(err) + } + if err = os.Symlink("./existing", filepath.Join(tmpDir, "linkexisting")); err != nil { + t.Fatal(err) + } files := listFiles(tmpDir) fmt.Println(files) testutils.AssertLen(t, 2, files, "Files") -- cgit v1.2.3