diff options
author | Alan Donovan <adonovan@google.com> | 2013-02-11 18:20:52 -0500 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2013-02-11 18:20:52 -0500 |
commit | 3d25b0827e2e3ec50f26209a1c43894f6fe1ff40 (patch) | |
tree | cf7526d0549ee03d48e782a0d21eb565d1b0d2e1 /test/reorder.go | |
parent | 6d4af3d1b5cd81a4c864298e0bf85b9840fdb689 (diff) | |
download | go-3d25b0827e2e3ec50f26209a1c43894f6fe1ff40.tar.gz |
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://codereview.appspot.com/7306087
Diffstat (limited to 'test/reorder.go')
-rw-r--r-- | test/reorder.go | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/test/reorder.go b/test/reorder.go index 0cdeebd0f..8fd623c1c 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 { |