PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/ruby-debug-0.10.2/test/test-trace.rb

https://github.com/technicalpickles/flockup
Ruby | 63 lines | 44 code | 15 blank | 4 comment | 0 complexity | 69a45e18be0c48d4e6e2bf509ab9249f MD5 | raw file
Possible License(s): GPL-2.0
  1. #!/usr/bin/env ruby
  2. require 'test/unit'
  3. # begin require 'rubygems' rescue LoadError end
  4. # require 'ruby-debug'; Debugger.start
  5. # Test 'edit' command handling.
  6. class TestEdit < Test::Unit::TestCase
  7. @@SRC_DIR = File.dirname(__FILE__) unless
  8. defined?(@@SRC_DIR)
  9. require File.join(@@SRC_DIR, 'helper')
  10. include TestHelper
  11. def test_trace_option
  12. filter = Proc.new{|got_lines, correct_lines|
  13. got_lines.collect!{|l| l =~ /:gcd\.rb:/? l : nil}.compact!
  14. }
  15. testname='trace'
  16. Dir.chdir(@@SRC_DIR) do
  17. assert_equal(true,
  18. run_debugger(testname,
  19. "-nx --trace gcd.rb 3 5", nil, filter))
  20. end
  21. end
  22. def test_linetrace_command
  23. filter = Proc.new{|got_lines, correct_lines|
  24. got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact!
  25. }
  26. testname='linetrace'
  27. Dir.chdir(@@SRC_DIR) do
  28. script = File.join('data', testname + '.cmd')
  29. assert_equal(true,
  30. run_debugger(testname,
  31. "--script #{script} -- gcd.rb 3 5", nil,
  32. filter))
  33. end
  34. end
  35. def test_linetrace_plus_command
  36. filter = Proc.new{|got_lines, correct_lines|
  37. got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact!
  38. }
  39. testname='linetracep'
  40. Dir.chdir(@@SRC_DIR) do
  41. script = File.join('data', testname + '.cmd')
  42. assert_equal(true,
  43. run_debugger(testname,
  44. "--script #{script} -- gcd.rb 3 5", nil,
  45. filter))
  46. end
  47. end
  48. end