]> Sergey Matveev's repositories - btrtrc.git/commitdiff
fs: Some test tidying
authorMatt Joiner <anacrolix@gmail.com>
Fri, 22 Sep 2017 03:46:00 +0000 (13:46 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 22 Sep 2017 03:46:00 +0000 (13:46 +1000)
fs/torrentfs_test.go

index ab3ab4bc61e66b3a8db909935b6e09789092601b..45e0cee7c2318b48423824f66f3ee9cd56ac8f46 100644 (file)
@@ -103,8 +103,9 @@ func TestUnmountWedged(t *testing.T) {
        fuseConn, err := fuse.Mount(layout.MountDir)
        if err != nil {
                switch err.Error() {
-               case "cannot locate OSXFUSE",
-                       "fusermount: exit status 1":
+               case "cannot locate OSXFUSE":
+                       fallthrough
+               case "fusermount: exit status 1":
                        t.Skip(err)
                }
                t.Fatal(err)
@@ -134,9 +135,7 @@ func TestUnmountWedged(t *testing.T) {
        go func() {
                defer cancel()
                _, err := ioutil.ReadFile(filepath.Join(layout.MountDir, tt.Info().Name))
-               if err == nil {
-                       t.Fatal("expected error reading greeting")
-               }
+               require.Error(t, err)
        }()
 
        // Wait until the read has blocked inside the filesystem code.
@@ -159,9 +158,7 @@ func TestUnmountWedged(t *testing.T) {
        }
 
        err = fuseConn.Close()
-       if err != nil {
-               t.Fatalf("error closing fuse conn: %s", err)
-       }
+       assert.NoError(t, err)
 }
 
 func TestDownloadOnDemand(t *testing.T) {