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

# · Ruby · 30 lines · 14 code · 8 blank · 8 comment · 6 complexity · 42277b3b89b6da3429d40ba0e2f093b4 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_private'
  11. include Using_private
  12. f = FooBar.new
  13. f.x = 3
  14. if f.blah(4) != 4
  15. raise RuntimeError, "blah(int)"
  16. end
  17. if f.defaulted() != -1
  18. raise RuntimeError, "defaulted()"
  19. end
  20. if f.defaulted(222) != 222
  21. raise RuntimeError, "defaulted(hi)"
  22. end