aboutsummaryrefslogtreecommitdiff
path: root/test/reorder.go
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2013-02-11 18:20:52 -0500
committerAlan Donovan <adonovan@google.com>2013-02-11 18:20:52 -0500
commit1c1096ea31ed50f3553382ebb81a6a16396e56ec (patch)
treee5694fb132d8aae3f55a8d340d14b173467a2193 /test/reorder.go
parentd282532901c02e3f2dde4ed3f2258bcb7a61d510 (diff)
downloadgo-1c1096ea31ed50f3553382ebb81a6a16396e56ec.tar.gz
go-1c1096ea31ed50f3553382ebb81a6a16396e56ec.zip
test: a number of fixes.
Details: - reorder.go: delete p8. (Once expectation is changed per b/4627 it is identical to p1.) - switch.go: added some more (degenerate) switches. - range.go: improved error messages in a few cases. - method.go: added tests of calls to promoted methods. R=iant CC=golang-dev https://golang.org/cl/7306087
Diffstat (limited to 'test/reorder.go')
-rw-r--r--test/reorder.go28
1 files changed, 6 insertions, 22 deletions
diff --git a/test/reorder.go b/test/reorder.go
index 0cdeebd0f3..8fd623c1c7 100644
--- a/test/reorder.go
+++ b/test/reorder.go
@@ -19,7 +19,6 @@ func main() {
p6()
p7()
p8()
- p9()
}
var gx []int
@@ -43,7 +42,7 @@ func check3(x, y, z, xx, yy, zz int) {
}
func p1() {
- x := []int{1,2,3}
+ x := []int{1, 2, 3}
i := 0
i, x[i] = 1, 100
_ = i
@@ -51,7 +50,7 @@ func p1() {
}
func p2() {
- x := []int{1,2,3}
+ x := []int{1, 2, 3}
i := 0
x[i], i = 100, 1
_ = i
@@ -59,7 +58,7 @@ func p2() {
}
func p3() {
- x := []int{1,2,3}
+ x := []int{1, 2, 3}
y := x
gx = x
x[1], y[0] = f(0), f(1)
@@ -67,7 +66,7 @@ func p3() {
}
func p4() {
- x := []int{1,2,3}
+ x := []int{1, 2, 3}
y := x
gx = x
x[1], y[0] = gx[0], gx[1]
@@ -75,7 +74,7 @@ func p4() {
}
func p5() {
- x := []int{1,2,3}
+ x := []int{1, 2, 3}
y := x
p := &x[0]
q := &x[1]
@@ -90,7 +89,7 @@ func p6() {
px := &x
py := &y
*px, *py = y, x
- check3(x, y, z, 2, 1, 3)
+ check3(x, y, z, 2, 1, 3)
}
func f1(x, y, z int) (xx, yy, zz int) {
@@ -107,21 +106,6 @@ func p7() {
}
func p8() {
- x := []int{1,2,3}
-
- defer func() {
- err := recover()
- if err == nil {
- panic("not panicking")
- }
- check(x, 100, 2, 3)
- }()
-
- i := 0
- i, x[i], x[5] = 1, 100, 500
-}
-
-func p9() {
m := make(map[int]int)
m[0] = len(m)
if m[0] != 0 {