PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Go | 72 lines | 55 code | 17 blank | 0 comment | 30 complexity | 7fdaa64ab9f4b0e0fccb35c686d19223 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. package main
  2. import . "./template_inherit"
  3. func main() {
  4. a := NewFooInt()
  5. b := NewFooDouble()
  6. c := NewBarInt()
  7. d := NewBarDouble()
  8. e := NewFooUInt()
  9. f := NewBarUInt()
  10. if a.Blah() != "Foo" {
  11. panic(0)
  12. }
  13. if b.Blah() != "Foo" {
  14. panic(0)
  15. }
  16. if e.Blah() != "Foo" {
  17. panic(0)
  18. }
  19. if c.Blah() != "Bar" {
  20. panic(0)
  21. }
  22. if d.Blah() != "Bar" {
  23. panic(0)
  24. }
  25. if f.Blah() != "Bar" {
  26. panic(0)
  27. }
  28. if c.Foomethod() != "foomethod" {
  29. panic(0)
  30. }
  31. if d.Foomethod() != "foomethod" {
  32. panic(0)
  33. }
  34. if f.Foomethod() != "foomethod" {
  35. panic(0)
  36. }
  37. if Invoke_blah_int(a) != "Foo" {
  38. panic(0)
  39. }
  40. if Invoke_blah_int(c) != "Bar" {
  41. panic(0)
  42. }
  43. if Invoke_blah_double(b) != "Foo" {
  44. panic(0)
  45. }
  46. if Invoke_blah_double(d) != "Bar" {
  47. panic(0)
  48. }
  49. if Invoke_blah_uint(e) != "Foo" {
  50. panic(0)
  51. }
  52. if Invoke_blah_uint(f) != "Bar" {
  53. panic(0)
  54. }
  55. }