From 814aa311c83db478573dc49a6ad140688b0b870b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 8 Apr 2015 01:43:50 +1000 Subject: [PATCH] fs: Improve test logging --- fs/torrentfs_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) } } -- 2.48.1