From aedafc05fd2fa9dd234188fd710ecf0c924f597a Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Thu, 5 Sep 2024 17:42:16 +0200 Subject: [PATCH] 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 --- src/go/printer/printer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/printer/printer_test.go b/src/go/printer/printer_test.go index 4d5d3eabedc..2a9c8be3003 100644 --- a/src/go/printer/printer_test.go +++ b/src/go/printer/printer_test.go @@ -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 }