diff options
Diffstat (limited to 'Examples/test-suite/go/argcargvtest_runme.go')
-rw-r--r-- | Examples/test-suite/go/argcargvtest_runme.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Examples/test-suite/go/argcargvtest_runme.go b/Examples/test-suite/go/argcargvtest_runme.go new file mode 100644 index 000000000..3da3d76dd --- /dev/null +++ b/Examples/test-suite/go/argcargvtest_runme.go @@ -0,0 +1,22 @@ +package main + +import wrap "swigtests/argcargvtest" + +func main() { + largs := []string{"hi", "hola", "hello"} + if ri := wrap.Mainc(largs); ri != 3 { + panic(ri) + } + + targs := []string{"hi", "hola"} + if rs := wrap.Mainv(targs, 1); rs != "hola" { + panic(rs) + } + +// For dynamically typed languages we test this throws an exception or similar +// at runtime, but for Go this doesn't even compile (but we can't easily +// test for that here). +// wrap.Mainv("hello", 1) + + wrap.InitializeApp(largs) +} |