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

# · Ruby · 22 lines · 14 code · 4 blank · 4 comment · 8 complexity · ebbfeeb172188e49003b659d6d27b1f7 MD5 · raw file

  1. #!/usr/bin/env ruby
  2. #
  3. # Test for li_cstring.i
  4. #
  5. require 'swig_assert'
  6. require 'li_cstring'
  7. include Li_cstring
  8. swig_assert_each_line <<EOF
  9. count("hello", 'l'[0]) == 2
  10. test1 == 'Hello World'
  11. test2
  12. test3('hello') == 'hello-suffix'
  13. test4('hello') == 'hello-suffix'
  14. test5(5) == 'xxxxx'
  15. test6(6) == 'xxx'
  16. test7 == 'Hello world!'
  17. test8 == (32..32+63).map {|x| x.chr }.join
  18. EOF