Skip to content

Commit

Permalink
imports: Limit the amount of text printed in the large token case
Browse files Browse the repository at this point in the history
If the test fails, it tries to print a million characters.
This limits it to just the start of got and want, which is enough to see
the imports block anyway.

Change-Id: I2c58db8e96e73da436ca16fa8a57c820a95242ca
Reviewed-on: https://go-review.googlesource.com/100216
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
ianthehat authored and bradfitz committed Mar 13, 2018
1 parent 059bec9 commit c1547a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions imports/fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2090,8 +2090,7 @@ const x = mypkg.Sprintf("%s", "my package")
// end
`

if got := string(out); got != want {
t.Errorf("Process returned unexpected result.\ngot:\n%v\nwant:\n%v", got, want)
t.Errorf("Process returned unexpected result.\ngot:\n%.100v\nwant:\n%.100v", got, want)
}
}

0 comments on commit c1547a3

Please sign in to comment.