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

# · Go · 29 lines · 24 code · 5 blank · 0 comment · 2 complexity · 8b1f05342ca3710a8ec95b29d359fdc1 MD5 · raw file

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