summaryrefslogtreecommitdiff
path: root/src/cmd/gofmt
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-09-14 11:29:18 -0400
committerRuss Cox <rsc@golang.org>2011-09-14 11:29:18 -0400
commitc8560a1ec043c107b260bc4725e3b03a2f23ffa9 (patch)
treea50d0b46e1fa516fc376d1cb5914158b10b06336 /src/cmd/gofmt
parent4b4e2fc38ab924c29e6581909d68478d169a7bfc (diff)
downloadgo-c8560a1ec043c107b260bc4725e3b03a2f23ffa9.tar.gz
gofmt: add else test
R=gri CC=golang-dev http://codereview.appspot.com/4978065
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r--src/cmd/gofmt/gofmt_test.go1
-rw-r--r--src/cmd/gofmt/testdata/old.golden9
-rw-r--r--src/cmd/gofmt/testdata/old.input8
3 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go
index 59cd56e07..87b02dad7 100644
--- a/src/cmd/gofmt/gofmt_test.go
+++ b/src/cmd/gofmt/gofmt_test.go
@@ -73,6 +73,7 @@ var tests = []struct {
{"gofmt.go", ""},
{"gofmt_test.go", ""},
{"testdata/composites.input", "-s"},
+ {"testdata/old.input", ""},
{"testdata/rewrite1.input", "-r=Foo->Bar"},
{"testdata/rewrite2.input", "-r=int->bool"},
{"testdata/stdin*.input", "-stdin"},
diff --git a/src/cmd/gofmt/testdata/old.golden b/src/cmd/gofmt/testdata/old.golden
new file mode 100644
index 000000000..95a0b72a0
--- /dev/null
+++ b/src/cmd/gofmt/testdata/old.golden
@@ -0,0 +1,9 @@
+package P
+
+func f() {
+ if x {
+ y
+ } else {
+ z
+ }
+}
diff --git a/src/cmd/gofmt/testdata/old.input b/src/cmd/gofmt/testdata/old.input
new file mode 100644
index 000000000..e24eed215
--- /dev/null
+++ b/src/cmd/gofmt/testdata/old.input
@@ -0,0 +1,8 @@
+package P
+
+func f() {
+ if x {
+ y
+ } else
+ z
+}