imports: Limit the amount of text printed in the large token case

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 <bradfitz@golang.org>
This commit is contained in:
Ian Cottrell 2018-03-12 19:32:48 -04:00 committed by Brad Fitzpatrick
parent 059bec968c
commit c1547a3f90

View File

@ -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)
}
}