mirror of
https://github.com/ddworken/hishtory.git
synced 2025-04-10 18:48:26 +02:00
Add more verbose output for golden failures
This commit is contained in:
parent
1fd3c23e62
commit
c70134a6fb
@ -1745,7 +1745,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 for %s at %s:%d (-expected +got):\n%s", goldenName, filename, line, diff)
|
||||
t.Fatalf("hishtory golden mismatch for %s at %s:%d (-expected +got):\n%s\nactual=\n%s", goldenName, filename, line, diff, out)
|
||||
} else {
|
||||
testutils.Check(t, os.WriteFile(goldenPath, []byte(out), 0644))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user