diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-03-04 21:27:36 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-03-04 21:27:36 +0100 |
commit | 04b08da9af0c450d645ab7389d1467308cfc2db8 (patch) | |
tree | db247935fa4f2f94408edc3acd5d0d4f997aa0d8 /test/bigalg.go | |
parent | 917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff) | |
download | golang-upstream/1.1_hg20130304.tar.gz |
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
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 |