aboutsummaryrefslogtreecommitdiff
path: root/tests/example_filesystems
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-11-26 15:17:15 +0100
committerJakob Unterwurzacher2016-11-26 15:20:54 +0100
commit3f5c48e0585f6fe0782aded541e42879eb570e69 (patch)
treebbec927ead78447195a719134e060842c1c46ec2 /tests/example_filesystems
parenta6006c0d2bcef66cc3c6a6bb22de747b9be874c1 (diff)
tests: don't call t.Fatal in checkExampleFS
Calling t.Fatal means that the parent test has no chance to clean up.
Diffstat (limited to 'tests/example_filesystems')
-rw-r--r--tests/example_filesystems/example_test_helpers.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/example_filesystems/example_test_helpers.go b/tests/example_filesystems/example_test_helpers.go
index 615e4c1..d89b35f 100644
--- a/tests/example_filesystems/example_test_helpers.go
+++ b/tests/example_filesystems/example_test_helpers.go
@@ -15,7 +15,8 @@ func checkExampleFS(t *testing.T, dir string, rw bool) {
statusFile := filepath.Join(dir, "status.txt")
contentBytes, err := ioutil.ReadFile(statusFile)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
content := string(contentBytes)
if content != statusTxtContent {
@@ -25,7 +26,8 @@ func checkExampleFS(t *testing.T, dir string, rw bool) {
symlink := filepath.Join(dir, "rel")
target, err := os.Readlink(symlink)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
if target != "status.txt" {
t.Errorf("Unexpected link target: %s\n", target)
@@ -34,12 +36,12 @@ func checkExampleFS(t *testing.T, dir string, rw bool) {
symlink = filepath.Join(dir, "abs")
target, err = os.Readlink(symlink)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
if target != "/a/b/c/d" {
t.Errorf("Unexpected link target: %s\n", target)
}
-
if rw {
// Test directory operations
test_helpers.TestRename(t, dir)