Skip to content

Commit

Permalink
go/printer: mention that input file is formatted in TestFiles error m…
Browse files Browse the repository at this point in the history
…essage

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: aedafc0
GitHub-Pull-Request: golang#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>
  • Loading branch information
mateusz834 authored and gopherbot committed Sep 6, 2024
1 parent d1ce116 commit 8cb6143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/go/printer/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8cb6143

Please sign in to comment.