Skip to content

Commit

Permalink
more useful test failure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Mar 14, 2023
1 parent 290b868 commit e539035
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/themes/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,22 @@ 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)
if err != nil {
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 {
Expand Down

0 comments on commit e539035

Please sign in to comment.