diff options
Diffstat (limited to 'test/range.go')
-rw-r--r-- | test/range.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/range.go b/test/range.go index b0f3ae605..68b0c9a2f 100644 --- a/test/range.go +++ b/test/range.go @@ -58,6 +58,17 @@ func testslice() { println("wrong sum ranging over makeslice") panic("fail") } + + x := []int{10, 20} + y := []int{99} + i := 1 + for i, x[i] = range y { + break + } + if i != 0 || x[0] != 10 || x[1] != 99 { + println("wrong parallel assignment", i, x[0], x[1]) + panic("fail") + } } func testslice1() { |