| 1 |
// Copyright 2012 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package main |
| 6 |
|
| 7 |
import "./a" |
| 8 |
|
| 9 |
func main() { |
| 10 |
s := a.Func() |
| 11 |
if s[0] != 1 { |
| 12 |
println(s[0]) |
| 13 |
panic("s[0] != 1") |
| 14 |
} |
| 15 |
if s[1] != 2+3i { |
| 16 |
println(s[1]) |
| 17 |
panic("s[1] != 2+3i") |
| 18 |
} |
| 19 |
if s[2] != 4+5i { |
| 20 |
println(s[2]) |
| 21 |
panic("s[2] != 4+5i") |
| 22 |
} |
| 23 |
|
| 24 |
x := 1 + 2i |
| 25 |
y := a.Mul(x) |
| 26 |
if y != (1+2i)*(3+4i) { |
| 27 |
println(y) |
| 28 |
panic("y != (1+2i)*(3+4i)") |
| 29 |
} |
| 30 |
} |