swig/Examples/test-suite/go/multi_import_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

29 lines
441 B
Go

package main
import "swigtests/multi_import_a"
import "swigtests/multi_import_b"
func main() {
x := multi_import_b.NewXXX()
if x.Testx() != 0 {
panic(0)
}
y := multi_import_b.NewYYY()
if y.Testx() != 0 {
panic(0)
}
if y.Testy() != 1 {
panic(0)
}
z := multi_import_a.NewZZZ()
if z.Testx() != 0 {
println("z.Testx", z.Testx(), z.Testz())
panic(0)
}
if z.Testz() != 2 {
println("z.Testz", z.Testz())
panic(0)
}
}