]> Cypherpunks repositories - gostls13.git/commitdiff
go/printer: mention that input file is formatted in TestFiles error message
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Thu, 5 Sep 2024 16:07:13 +0000 (16:07 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 6 Sep 2024 13:22:32 +0000 (13:22 +0000)
Currently when one of the tests in TestFiles fail, 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: Id5c080c5237acd82303d2f41cace8a3fe9ea08e0
GitHub-Last-Rev: aedafc05fd2fa9dd234188fd710ecf0c924f597a
GitHub-Pull-Request: golang/go#69292
Reviewed-on: https://go-review.googlesource.com/c/go/+/610559
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/go/printer/printer_test.go

index 00bb842cc89b85ab218985e7a24901a51f1e5bb7..d541a544651d2a50b14deba8c51459750bf12118 100644 (file)
@@ -126,7 +126,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
        }