swig/Examples/test-suite/go/smart_pointer_extend_runme.go
Ian Lance Taylor 8a1c09e280 Fix Go tests to run in module mode
Stop using relative imports and add a go.mod file.

Tested against Go 1.6 through Go pre-1.13, and gccgo.
2019-04-24 21:43:38 -07:00

40 lines
461 B
Go

package main
import . "smart_pointer_extend"
func main() {
f := NewFoo()
b := NewBar(f)
if b.Extension() != f.Extension() {
panic(0)
}
b2 := NewCBase()
d := NewCDerived()
p := NewCPtr()
if b2.Bar() != p.Bar() {
panic(0)
}
if d.Foo() != p.Foo() {
panic(0)
}
if CBaseHello() != p.Hello() {
panic(0)
}
d2 := NewDFoo()
dp := NewDPtrFoo(d2)
if DFooSExt(1) != dp.SExt(1) {
panic(0)
}
if d2.Ext(1) != dp.Ext(1) {
panic(0)
}
}