LEFT | RIGHT |
(no file at all) | |
1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: tuple evaluation order | 1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: tuple evaluation order |
2 | 2 |
3 // Copyright 2010 The Go Authors. All rights reserved. | 3 // Copyright 2010 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 // Test order of evaluation in tuple assignments. | 7 // Test order of evaluation in tuple assignments. |
8 | 8 |
9 package main | 9 package main |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // 11 12 | 86 // 11 12 |
87 *f(), p2 = m[gint()] | 87 *f(), p2 = m[gint()] |
88 a[11] += '0' | 88 a[11] += '0' |
89 if !p1 || p2 { | 89 if !p1 || p2 { |
90 println("bad map check", i, p1, p2) | 90 println("bad map check", i, p1, p2) |
91 panic("fail") | 91 panic("fail") |
92 } | 92 } |
93 | 93 |
94 m[13] = 'B' | 94 m[13] = 'B' |
95 // 13 14 | 95 // 13 14 |
96 » m[gint()] = gbyte(), false | 96 » delete(m, gint()) |
| 97 » gbyte() |
97 if _, present := m[13]; present { | 98 if _, present := m[13]; present { |
98 println("bad map removal") | 99 println("bad map removal") |
99 panic("fail") | 100 panic("fail") |
100 } | 101 } |
101 | 102 |
102 c := make(chan byte, 1) | 103 c := make(chan byte, 1) |
103 c <- 'C' | 104 c <- 'C' |
104 // 15 16 | 105 // 15 16 |
105 *f(), p1 = <-e1(c, 16) | 106 *f(), p1 = <-e1(c, 16) |
106 close(c) | 107 close(c) |
(...skipping 16 matching lines...) Expand all Loading... |
123 println("bad interface check", i, p1, p2) | 124 println("bad interface check", i, p1, p2) |
124 panic("fail") | 125 panic("fail") |
125 } | 126 } |
126 | 127 |
127 s := string(a[0:i]) | 128 s := string(a[0:i]) |
128 if s != "def ii A 0 C 0 " { | 129 if s != "def ii A 0 C 0 " { |
129 println("bad array results:", s) | 130 println("bad array results:", s) |
130 panic("fail") | 131 panic("fail") |
131 } | 132 } |
132 } | 133 } |
LEFT | RIGHT |