PageRenderTime 63ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Ruby | 30 lines | 17 code | 4 blank | 9 comment | 5 complexity | aa9e7596d48d5bf4f0d9d268165ff659 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #!/usr/bin/env ruby
  2. #
  3. # A simple std::stack test
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'li_std_stack'
  11. include Li_std_stack
  12. swig_assert_each_line(<<'EOF', binding)
  13. a = IntStack.new
  14. a << 1
  15. a << 2
  16. a << 3
  17. a.top == 3
  18. a.pop
  19. a.top == 2
  20. a.pop
  21. a.top == 1
  22. a.pop
  23. a.size == 0
  24. a.empty? == true
  25. # a.top == Qnil
  26. EOF