swig/Examples/test-suite/go/template_inherit_runme.go
Ian Lance Taylor 7aafe3d8b2 Fix all Go tests to build with "go build"
Tested against Go 1.6 through Go 1.13beta1, and gccgo.

Fixes #1607
2019-08-08 14:30:50 -07:00

72 lines
871 B
Go

package main
import . "swigtests/template_inherit"
func main() {
a := NewFooInt()
b := NewFooDouble()
c := NewBarInt()
d := NewBarDouble()
e := NewFooUInt()
f := NewBarUInt()
if a.Blah() != "Foo" {
panic(0)
}
if b.Blah() != "Foo" {
panic(0)
}
if e.Blah() != "Foo" {
panic(0)
}
if c.Blah() != "Bar" {
panic(0)
}
if d.Blah() != "Bar" {
panic(0)
}
if f.Blah() != "Bar" {
panic(0)
}
if c.Foomethod() != "foomethod" {
panic(0)
}
if d.Foomethod() != "foomethod" {
panic(0)
}
if f.Foomethod() != "foomethod" {
panic(0)
}
if Invoke_blah_int(a) != "Foo" {
panic(0)
}
if Invoke_blah_int(c) != "Bar" {
panic(0)
}
if Invoke_blah_double(b) != "Foo" {
panic(0)
}
if Invoke_blah_double(d) != "Bar" {
panic(0)
}
if Invoke_blah_uint(e) != "Foo" {
panic(0)
}
if Invoke_blah_uint(f) != "Bar" {
panic(0)
}
}