/trunk/Examples/test-suite/ruby/using_composition_runme.rb

# · Ruby · 56 lines · 33 code · 15 blank · 8 comment · 18 complexity · 14a96cd1006f0d1355b03ac4ba5bda37 MD5 · raw file

  1. #!/usr/bin/env ruby
  2. #
  3. # Put description here
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'using_composition'
  11. include Using_composition
  12. f = FooBar.new
  13. if f.blah(3) != 3
  14. raise RuntimeError,"FooBar::blah(int)"
  15. end
  16. if f.blah(3.5) != 3.5
  17. raise RuntimeError,"FooBar::blah(double)"
  18. end
  19. if f.blah("hello") != "hello"
  20. raise RuntimeError,"FooBar::blah(char *)"
  21. end
  22. f = FooBar2.new
  23. if f.blah(3) != 3
  24. raise RuntimeError,"FooBar2::blah(int)"
  25. end
  26. if f.blah(3.5) != 3.5
  27. raise RuntimeError,"FooBar2::blah(double)"
  28. end
  29. if f.blah("hello") != "hello"
  30. raise RuntimeError,"FooBar2::blah(char *)"
  31. end
  32. f = FooBar3.new
  33. if f.blah(3) != 3
  34. raise RuntimeError,"FooBar3::blah(int)"
  35. end
  36. if f.blah(3.5) != 3.5
  37. raise RuntimeError,"FooBar3::blah(double)"
  38. end
  39. if f.blah("hello") != "hello"
  40. raise RuntimeError,"FooBar3::blah(char *)"
  41. end