PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Ruby | 36 lines | 19 code | 9 blank | 8 comment | 10 complexity | e6e1c4cabe350a8e792345e4454961cd MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #!/usr/bin/env ruby
  2. #
  3. # Put description here
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'using_extend'
  11. include Using_extend
  12. f = FooBar.new
  13. if f.blah(3) != 3
  14. raise RuntimeError,"blah(int)"
  15. end
  16. if f.blah(3.5) != 3.5
  17. raise RuntimeError,"blah(double)"
  18. end
  19. if f.blah("hello") != "hello"
  20. raise RuntimeError,"blah(char *)"
  21. end
  22. if f.blah(3,4) != 7
  23. raise RuntimeError,"blah(int,int)"
  24. end
  25. if f.blah(3.5,7.5) != (3.5+7.5)
  26. raise RuntimeError,"blah(double,double)"
  27. end