From e539035639dcf8bd53e1a9f5d8f07ae9063ecdee Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Mar 2023 20:51:10 +0530 Subject: [PATCH] more useful test failure messages --- tools/themes/collection_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/themes/collection_test.go b/tools/themes/collection_test.go index 6d7c70568..d100a82b8 100644 --- a/tools/themes/collection_test.go +++ b/tools/themes/collection_test.go @@ -110,7 +110,7 @@ func TestThemeCollections(t *testing.T) { t.Fatal(err) } if request_count != 1 { - t.Fatal("Cached zip file was not used") + t.Fatalf("Cached zip file was not used: %d", request_count) } before, _ := os.Stat(filepath.Join(tdir, "test.zip")) _, err = fetch_cached("test", ts.URL, tdir, 0) @@ -118,14 +118,14 @@ func TestThemeCollections(t *testing.T) { t.Fatal(err) } if request_count != 2 { - t.Fatal("Cached zip file was incorrectly used") + t.Fatalf("Cached zip file was incorrectly used: %d", request_count) } if received_etag != `"xxx"` { t.Fatalf("Got invalid ETag: %#v", received_etag) } after, _ := os.Stat(filepath.Join(tdir, "test.zip")) if before.ModTime() != after.ModTime() { - t.Fatal("Cached zip file was incorrectly re-downloaded") + t.Fatalf("Cached zip file was incorrectly re-downloaded: %s", cmp.Diff(before.ModTime(), after.ModTime())) } err = os.Chtimes(filepath.Join(tdir, "test.zip"), time.Time{}, time.Time{}) if err != nil {