From: Matt Joiner Date: Fri, 22 Sep 2017 03:46:00 +0000 (+1000) Subject: fs: Some test tidying X-Git-Tag: v1.0.0~374 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=25d1f371c32e1de050337dd69d55f0c2c8b3d470;p=btrtrc.git fs: Some test tidying --- diff --git a/fs/torrentfs_test.go b/fs/torrentfs_test.go index ab3ab4bc..45e0cee7 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -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) {