diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-03-04 21:27:36 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-03-04 21:27:36 +0100 |
commit | 04b08da9af0c450d645ab7389d1467308cfc2db8 (patch) | |
tree | db247935fa4f2f94408edc3acd5d0d4f997aa0d8 /test/reorder.go | |
parent | 917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff) | |
download | golang-04b08da9af0c450d645ab7389d1467308cfc2db8.tar.gz |
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'test/reorder.go')
-rw-r--r-- | test/reorder.go | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/test/reorder.go b/test/reorder.go index 007039e8a..8fd623c1c 100644 --- a/test/reorder.go +++ b/test/reorder.go @@ -42,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 @@ -50,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 @@ -58,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) @@ -66,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] @@ -74,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] @@ -89,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) { @@ -106,16 +106,9 @@ 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 + m := make(map[int]int) + m[0] = len(m) + if m[0] != 0 { + panic(m[0]) + } } |