Add support for the Go programming language.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12108 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
09f14197ac
commit
5af2978f77
259 changed files with 16159 additions and 14 deletions
50
Examples/test-suite/go/constover_runme.go
Normal file
50
Examples/test-suite/go/constover_runme.go
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"./constover"
|
||||
)
|
||||
|
||||
func main() {
|
||||
error := 0
|
||||
|
||||
p := constover.Test("test")
|
||||
if p != "test" {
|
||||
fmt.Println("test failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
p = constover.Test_pconst("test")
|
||||
if p != "test_pconst" {
|
||||
fmt.Println("test_pconst failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
f := constover.NewFoo()
|
||||
p = f.Test("test")
|
||||
if p != "test" {
|
||||
fmt.Println("member-test failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
p = f.Test_pconst("test")
|
||||
if p != "test_pconst" {
|
||||
fmt.Println("member-test_pconst failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
p = f.Test_constm("test")
|
||||
if p != "test_constmethod" {
|
||||
fmt.Println("member-test_constm failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
p = f.Test_pconstm("test")
|
||||
if p != "test_pconstmethod" {
|
||||
fmt.Println("member-test_pconstm failed!")
|
||||
error = 1
|
||||
}
|
||||
|
||||
os.Exit(error)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue