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:
Ian Lance Taylor 2011-02-20 04:40:00 +00:00
commit bb3caf14a2

View 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)
}
}