From: Matt Joiner Date: Tue, 7 Apr 2015 15:43:50 +0000 (+1000) Subject: fs: Improve test logging X-Git-Tag: v1.0.0~1209 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=814aa311c83db478573dc49a6ad140688b0b870b;p=btrtrc.git fs: Improve test logging --- diff --git a/fs/torrentfs_test.go b/fs/torrentfs_test.go index f45b7d81..ad8ac375 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io/ioutil" + "log" "net" "net/http" _ "net/http/pprof" @@ -26,6 +27,10 @@ import ( "github.com/anacrolix/torrent/util" ) +func init() { + log.SetFlags(log.Flags() | log.Lshortfile) +} + func TestTCPAddrString(t *testing.T) { l, err := net.Listen("tcp4", "localhost:0") if err != nil { @@ -238,6 +243,6 @@ func TestDownloadOnDemand(t *testing.T) { }, resp) content := resp.Data if string(content) != testutil.GreetingFileContents { - t.FailNow() + t.Fatalf("%q != %q", string(content), testutil.GreetingFileContents) } }