From c1547a3f90f245aa85784a99580d3f601380cc07 Mon Sep 17 00:00:00 2001 From: Ian Cottrell Date: Mon, 12 Mar 2018 19:32:48 -0400 Subject: [PATCH] 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 --- imports/fix_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imports/fix_test.go b/imports/fix_test.go index b8d51a3646..9d93b65976 100644 --- a/imports/fix_test.go +++ b/imports/fix_test.go @@ -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) } }