autogold
autogold copied to clipboard
add t.Helper to make file:line results more useful
With usage t.Hepler() when we got user code line instead of lib line in go test message.
Hi! Thanks for your work! With this change errors in example folders will print files and lines with broken tests instead of library code.
➜ example git:(main) ✗ go test ./... git:(main|✚2
--- FAIL: TestInline (0.04s)
example_test.go:19: mismatch (-want +got):
--- want
+++ got
@@ -1 +1 @@
-&Baz{Name: "Jane", Age: 42}
\ No newline at end of file
+&Baz{Name: "Jane", Age: 31}
\ No newline at end of file
--- FAIL: TestSubtest (0.00s)
--- FAIL: TestSubtest/mysubtest (0.00s)
example_test.go:29: mismatch (-want +got):
--- want
+++ got
@@ -1 +1 @@
-&Baz{Name: "Jane", Age: 42}
\ No newline at end of file
+&Baz{Name: "Jane", Age: 31}
\ No newline at end of file
FAIL
FAIL github.com/hexops/autogold/example 0.712s
FAIL
@slimsag would like to see this one go in too. I can see this failed a DCO check, but I’m not sure the current PR builds are checking for this?