PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/go/rename_simple_runme.go

#
Go | 29 lines | 24 code | 5 blank | 0 comment | 2 complexity | 8b1f05342ca3710a8ec95b29d359fdc1 MD5 | raw file
 1package main
 2
 3import "fmt"
 4import . "./rename_simple"
 5
 6func main() {
 7	s := NewNewStruct()
 8	check(111, s.GetNewInstanceVariable(), "NewInstanceVariable")
 9	check(222, s.NewInstanceMethod(), "NewInstanceMethod")
10	check(333, NewStructNewStaticMethod(), "NewStaticMethod")
11	check(444, GetNewStructNewStaticVariable(), "NewStaticVariable")
12	check(555, NewFunction(), "NewFunction")
13	check(666, GetNewGlobalVariable(), "NewGlobalVariable")
14
15	s.SetNewInstanceVariable(1111)
16	SetNewStructNewStaticVariable(4444)
17	SetNewGlobalVariable(6666)
18
19	check(1111, s.GetNewInstanceVariable(), "NewInstanceVariable")
20	check(4444, GetNewStructNewStaticVariable(), "NewStaticVariable")
21	check(6666, GetNewGlobalVariable(), "NewGlobalVariable")
22}
23
24func check(expected, actual int, msg string) {
25	if expected != actual {
26		panic("Failed: Expected: " + fmt.Sprint(expected) +
27			" actual: " + fmt.Sprint(actual) + " " + msg)
28	}
29}