PageRenderTime 32ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/test-suite/ruby/typedef_inherit_runme.rb

#
Ruby | 27 lines | 21 code | 6 blank | 0 comment | 8 complexity | 64f0436e457682929a784448e1106203 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. require 'typedef_inherit'
  2. a = Typedef_inherit::Foo.new
  3. b = Typedef_inherit::Bar.new
  4. x = Typedef_inherit.do_blah(a)
  5. if x != "Foo::blah"
  6. puts "Whoa! Bad return #{x}"
  7. end
  8. x = Typedef_inherit.do_blah(b)
  9. if x != "Bar::blah"
  10. puts "Whoa! Bad return #{x}"
  11. end
  12. c = Typedef_inherit::Spam.new
  13. d = Typedef_inherit::Grok.new
  14. x = Typedef_inherit.do_blah2(c)
  15. if x != "Spam::blah"
  16. puts "Whoa! Bad return #{x}"
  17. end
  18. x = Typedef_inherit.do_blah2(d)
  19. if x != "Grok::blah"
  20. puts "Whoa! Bad return #{x}"
  21. end