mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-22 22:28:51 +01:00
Better error message for goldens
This commit is contained in:
parent
0f9e77223e
commit
51096276b6
@ -1754,7 +1754,7 @@ func compareGoldens(t *testing.T, out, goldenName string) {
|
||||
if diff := cmp.Diff(string(expected), out); diff != "" {
|
||||
if os.Getenv("HISHTORY_UPDATE_GOLDENS") == "" {
|
||||
_, filename, line, _ := runtime.Caller(1)
|
||||
t.Fatalf("hishtory golden mismatch at %s:%d (-expected +got):\n%s", filename, line, diff)
|
||||
t.Fatalf("hishtory golden mismatch for %s at %s:%d (-expected +got):\n%s", goldenName, filename, line, diff)
|
||||
} else {
|
||||
testutils.Check(t, os.WriteFile(goldenPath, []byte(out), 0644))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user