summaryrefslogtreecommitdiff
path: root/src/cmd/gofmt/gofmt_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2011-04-14 14:25:25 -0700
committerRobert Griesemer <gri@golang.org>2011-04-14 14:25:25 -0700
commita49e7f393fe62d97dae691fdada7ab134fb83b6b (patch)
tree9cd9af88c525448ab36ada9f898d483fdef9676c /src/cmd/gofmt/gofmt_test.go
parent881b1b4a025486d90a2d9caf6f7a3a7634a93c6d (diff)
downloadgo-git-a49e7f393fe62d97dae691fdada7ab134fb83b6b.tar.gz
gofmt: don't crash when rewriting nil interfaces in AST.
The new reflection API makes it an error to call value.Set(x) if x is invalid. Guard for it. Added corresponding test case. Fixes #1696. R=rsc, r CC=golang-dev https://golang.org/cl/4398047
Diffstat (limited to 'src/cmd/gofmt/gofmt_test.go')
-rw-r--r--src/cmd/gofmt/gofmt_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go
index 4ec94e2933..a72530307e 100644
--- a/src/cmd/gofmt/gofmt_test.go
+++ b/src/cmd/gofmt/gofmt_test.go
@@ -71,6 +71,7 @@ var tests = []struct {
{".", "gofmt_test.go", "gofmt_test.go", ""},
{"testdata", "composites.input", "composites.golden", "-s"},
{"testdata", "rewrite1.input", "rewrite1.golden", "-r=Foo->Bar"},
+ {"testdata", "rewrite2.input", "rewrite2.golden", "-r=int->bool"},
}