3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test order of evaluation in tuple assignments.
26 func x() (byte, byte) {
28 return 'a' + i - 1, 'a' + i - 1
30 func e1(c chan byte, expected byte) chan byte {
32 println("e1: got", i, "expected", expected)
39 type Empty interface{}
47 func (p S1) Get() byte { return p.i }
53 func e2(p Empty, expected byte) Empty {
55 println("e2: got", i, "expected", expected)
61 func e3(p *I, expected byte) *I {
63 println("e3: got", i, "expected", expected)
76 *f(), *f(), *f() = gbyte(), gbyte(), gbyte()
81 m := make(map[byte]byte)
90 println("bad map check", i, p1, p2)
98 if _, present := m[13]; present {
99 println("bad map removal")
103 c := make(chan byte, 1)
106 *f(), p1 = <-e1(c, 16)
109 *f(), p2 = <-e1(c, 18)
112 println("bad chan check", i, p1, p2)
120 *e3(&iv, 19), p1 = e2(s1, 20).(I)
122 *e3(&iv, 21), p2 = e2(s2, 22).(I)
124 println("bad interface check", i, p1, p2)
129 if s != "def ii A 0 C 0 " {
130 println("bad array results:", s)