Add Go execution test for new rename_simple test.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12494 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
56d808092f
commit
bb3caf14a2
1 changed files with 29 additions and 0 deletions
29
Examples/test-suite/go/rename_simple_runme.go
Normal file
29
Examples/test-suite/go/rename_simple_runme.go
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
import . "./rename_simple"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
s := NewNewStruct()
|
||||||
|
check(111, s.GetNewInstanceVariable(), "NewInstanceVariable")
|
||||||
|
check(222, s.NewInstanceMethod(), "NewInstanceMethod")
|
||||||
|
check(333, NewStructNewStaticMethod(), "NewStaticMethod")
|
||||||
|
check(444, GetNewStructNewStaticVariable(), "NewStaticVariable")
|
||||||
|
check(555, NewFunction(), "NewFunction")
|
||||||
|
check(666, GetNewGlobalVariable(), "NewGlobalVariable")
|
||||||
|
|
||||||
|
s.SetNewInstanceVariable(1111)
|
||||||
|
SetNewStructNewStaticVariable(4444)
|
||||||
|
SetNewGlobalVariable(6666)
|
||||||
|
|
||||||
|
check(1111, s.GetNewInstanceVariable(), "NewInstanceVariable")
|
||||||
|
check(4444, GetNewStructNewStaticVariable(), "NewStaticVariable")
|
||||||
|
check(6666, GetNewGlobalVariable(), "NewGlobalVariable")
|
||||||
|
}
|
||||||
|
|
||||||
|
func check(expected, actual int, msg string) {
|
||||||
|
if expected != actual {
|
||||||
|
panic("Failed: Expected: " + fmt.Sprint(expected) +
|
||||||
|
" actual: " + fmt.Sprint(actual) + " " + msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue