]> Cypherpunks repositories - gostls13.git/commitdiff
gofmt: add else test
authorRuss Cox <rsc@golang.org>
Wed, 14 Sep 2011 15:29:18 +0000 (11:29 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 14 Sep 2011 15:29:18 +0000 (11:29 -0400)
R=gri
CC=golang-dev
https://golang.org/cl/4978065

src/cmd/gofmt/gofmt_test.go
src/cmd/gofmt/testdata/old.golden [new file with mode: 0644]
src/cmd/gofmt/testdata/old.input [new file with mode: 0644]

index 59cd56e0727bedb23b1849ef13ae5df277deefd3..87b02dad7dfec23dc0d251812e4c1c0b2d0d10ce 100644 (file)
@@ -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 (file)
index 0000000..95a0b72
--- /dev/null
@@ -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 (file)
index 0000000..e24eed2
--- /dev/null
@@ -0,0 +1,8 @@
+package P
+
+func f() {
+       if x {
+               y
+       } else
+               z
+}