From: Joe Tsai Date: Fri, 16 Aug 2019 17:42:18 +0000 (-0700) Subject: cmd/gofmt: update TestRewrite to avoid future regressions X-Git-Tag: go1.13rc1~8 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb5441de4893c0802e3445250fbcc13c7b8e105c;p=gostls13.git cmd/gofmt: update TestRewrite to avoid future regressions CL 162337 changed go/ast to better handle block comments, but was reverted because it introduced an off-by-one bug. This CL adds a test case to enforce the correct behavior so that future changes do not break this again. Updates #18929 Updates #33538 Change-Id: I2d25c139d007f8db1091b7a48b1dd20c584e2699 Reviewed-on: https://go-review.googlesource.com/c/go/+/190523 Run-TryBot: Joe Tsai TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- diff --git a/src/cmd/gofmt/testdata/import.golden b/src/cmd/gofmt/testdata/import.golden index 51d7be79df..29bdc9baf4 100644 --- a/src/cmd/gofmt/testdata/import.golden +++ b/src/cmd/gofmt/testdata/import.golden @@ -8,6 +8,11 @@ import ( "math" ) +import ( + "fmt" + "math" +) + import ( "fmt" diff --git a/src/cmd/gofmt/testdata/import.input b/src/cmd/gofmt/testdata/import.input index 9a4b09dbf9..78ab4f6544 100644 --- a/src/cmd/gofmt/testdata/import.input +++ b/src/cmd/gofmt/testdata/import.input @@ -8,6 +8,9 @@ import ( "io" ) +import("fmt" +"math") + import ( "fmt"