diff options
Diffstat (limited to 'test/bigalg.go')
-rw-r--r-- | test/bigalg.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/bigalg.go b/test/bigalg.go index 55a15c30a..60e822942 100644 --- a/test/bigalg.go +++ b/test/bigalg.go @@ -15,18 +15,21 @@ type T struct { d byte } -var a = []int{ 1, 2, 3 } +var a = []int{1, 2, 3} var NIL []int func arraycmptest() { if NIL != nil { println("fail1:", NIL, "!= nil") + panic("bigalg") } if nil != NIL { println("fail2: nil !=", NIL) + panic("bigalg") } if a == nil || nil == a { println("fail3:", a, "== nil") + panic("bigalg") } } @@ -49,12 +52,14 @@ func maptest() { t1 := mt[0] if t1.a != t.a || t1.b != t.b || t1.c != t.c || t1.d != t.d { println("fail: map val struct", t1.a, t1.b, t1.c, t1.d) + panic("bigalg") } ma[1] = a a1 := ma[1] if !SameArray(a, a1) { println("fail: map val array", a, a1) + panic("bigalg") } } @@ -72,15 +77,18 @@ func chantest() { t1 := <-ct if t1.a != t.a || t1.b != t.b || t1.c != t.c || t1.d != t.d { println("fail: map val struct", t1.a, t1.b, t1.c, t1.d) + panic("bigalg") } a1 := <-ca if !SameArray(a, a1) { println("fail: map val array", a, a1) + panic("bigalg") } } -type E struct { } +type E struct{} + var e E func interfacetest() { @@ -90,6 +98,7 @@ func interfacetest() { a1 := i.([]int) if !SameArray(a, a1) { println("interface <-> []int", a, a1) + panic("bigalg") } pa := new([]int) *pa = a @@ -97,12 +106,14 @@ func interfacetest() { a1 = *i.(*[]int) if !SameArray(a, a1) { println("interface <-> *[]int", a, a1) + panic("bigalg") } i = t t1 := i.(T) if t1.a != t.a || t1.b != t.b || t1.c != t.c || t1.d != t.d { println("interface <-> struct", t1.a, t1.b, t1.c, t1.d) + panic("bigalg") } i = e |