1
0
mirror of https://github.com/golang/go synced 2024-11-25 08:07:57 -07:00

go/printer: show that input file is formatted in TestFiles error message

Currently when one of the tests TestFiles fails, then the error
looks like this:

--- testdata/generics.input
+++ testdata/generics.golden

which is confusing, with this change it will be:

--- format(testdata/generics.input)
+++ testdata/generics.golden

Change-Id: I4b471ab57b14ac63ed8ff244cc331e645478b414
This commit is contained in:
Mateusz Poliwczak 2024-09-05 17:42:16 +02:00
parent 2707d42966
commit aedafc05fd

View File

@ -125,7 +125,7 @@ func runcheck(t *testing.T, source, golden string, mode checkMode) {
}
// formatted source and golden must be the same
if err := checkEqual(source, golden, res, gld); err != nil {
if err := checkEqual(fmt.Sprintf("format(%v)", source), golden, res, gld); err != nil {
t.Error(err)
return
}