ruby-debug 0.10.5.rc1 → 0.10.5.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. data/ChangeLog +54 -0
  2. data/Rakefile +34 -239
  3. metadata +15 -182
  4. data/test/base/base.rb +0 -77
  5. data/test/base/binding.rb +0 -22
  6. data/test/base/catchpoint.rb +0 -19
  7. data/test/base/load.rb +0 -44
  8. data/test/base/reload_bug.rb +0 -8
  9. data/test/cli/commands/catchpoint_test.rb +0 -24
  10. data/test/cli/commands/unit/regexp.rb +0 -36
  11. data/test/config.yaml +0 -8
  12. data/test/data/annotate.cmd +0 -29
  13. data/test/data/annotate.right +0 -139
  14. data/test/data/at-exit.cmd +0 -4
  15. data/test/data/at-exit.right +0 -12
  16. data/test/data/break_bad.cmd +0 -16
  17. data/test/data/break_bad.right +0 -26
  18. data/test/data/break_loop_bug.cmd +0 -5
  19. data/test/data/break_loop_bug.right +0 -15
  20. data/test/data/break_tracelines.cmd +0 -9
  21. data/test/data/break_tracelines.right +0 -17
  22. data/test/data/breakpoints-basename.cmd +0 -2
  23. data/test/data/breakpoints-basename.right +0 -10
  24. data/test/data/breakpoints.cmd +0 -37
  25. data/test/data/breakpoints.right +0 -96
  26. data/test/data/brkpt-class-bug.cmd +0 -9
  27. data/test/data/brkpt-class-bug.right +0 -18
  28. data/test/data/catch.cmd +0 -18
  29. data/test/data/catch.right +0 -41
  30. data/test/data/condition.cmd +0 -29
  31. data/test/data/condition.right +0 -67
  32. data/test/data/continue_bad.cmd +0 -4
  33. data/test/data/continue_bad.right +0 -9
  34. data/test/data/ctrl.cmd +0 -23
  35. data/test/data/ctrl.right +0 -70
  36. data/test/data/display.cmd +0 -24
  37. data/test/data/display.right +0 -44
  38. data/test/data/dollar-0.right +0 -3
  39. data/test/data/dollar-0a.right +0 -3
  40. data/test/data/dollar-0b.right +0 -3
  41. data/test/data/edit.cmd +0 -12
  42. data/test/data/edit.right +0 -19
  43. data/test/data/emacs_basic.cmd +0 -10
  44. data/test/data/emacs_basic.right +0 -24
  45. data/test/data/enable.cmd +0 -20
  46. data/test/data/enable.right +0 -36
  47. data/test/data/except-bug1.cmd +0 -7
  48. data/test/data/except-bug1.right +0 -13
  49. data/test/data/file-with-space.cmd +0 -7
  50. data/test/data/file-with-space.right +0 -9
  51. data/test/data/finish.cmd +0 -16
  52. data/test/data/finish.right +0 -31
  53. data/test/data/frame.cmd +0 -29
  54. data/test/data/frame.right +0 -62
  55. data/test/data/help.cmd +0 -20
  56. data/test/data/help.right +0 -21
  57. data/test/data/history.right +0 -7
  58. data/test/data/info-file-break.cmd +0 -4
  59. data/test/data/info-file-break.right +0 -11
  60. data/test/data/info-thread.cmd +0 -13
  61. data/test/data/info-thread.right +0 -37
  62. data/test/data/info-var-bug2.cmd +0 -5
  63. data/test/data/info-var-bug2.right +0 -10
  64. data/test/data/info-var.cmd +0 -23
  65. data/test/data/info-var.right +0 -52
  66. data/test/data/info.cmd +0 -21
  67. data/test/data/info.right +0 -80
  68. data/test/data/linetrace-jruby.right +0 -23
  69. data/test/data/linetrace.cmd +0 -6
  70. data/test/data/linetrace.right +0 -32
  71. data/test/data/linetracep.cmd +0 -7
  72. data/test/data/linetracep.right +0 -25
  73. data/test/data/list.cmd +0 -19
  74. data/test/data/list.right +0 -127
  75. data/test/data/method.cmd +0 -10
  76. data/test/data/method.right +0 -21
  77. data/test/data/methodsig.cmd +0 -10
  78. data/test/data/methodsig.right +0 -20
  79. data/test/data/noquit.right +0 -1
  80. data/test/data/output.cmd +0 -6
  81. data/test/data/output.right +0 -31
  82. data/test/data/pm-bug.cmd +0 -7
  83. data/test/data/pm-bug.right +0 -12
  84. data/test/data/post-mortem-next.cmd +0 -8
  85. data/test/data/post-mortem-next.right +0 -14
  86. data/test/data/post-mortem-osx.right +0 -32
  87. data/test/data/post-mortem.cmd +0 -13
  88. data/test/data/post-mortem.right +0 -32
  89. data/test/data/quit.cmd +0 -6
  90. data/test/data/quit.right +0 -9
  91. data/test/data/raise-jruby.right +0 -26
  92. data/test/data/raise.cmd +0 -11
  93. data/test/data/raise.right +0 -26
  94. data/test/data/save.cmd +0 -34
  95. data/test/data/save.right +0 -61
  96. data/test/data/setshow.cmd +0 -46
  97. data/test/data/setshow.right +0 -80
  98. data/test/data/source.cmd +0 -5
  99. data/test/data/source.right +0 -15
  100. data/test/data/stepping.cmd +0 -21
  101. data/test/data/stepping.right +0 -50
  102. data/test/data/test-init-cygwin.right +0 -7
  103. data/test/data/test-init-osx.right +0 -4
  104. data/test/data/test-init.right +0 -5
  105. data/test/data/trace-jruby.right +0 -14
  106. data/test/data/trace.right +0 -23
  107. data/test/example/a/example.rb +0 -1
  108. data/test/example/at-exit.rb +0 -3
  109. data/test/example/b/example.rb +0 -1
  110. data/test/example/bp_loop_issue.rb +0 -3
  111. data/test/example/breakpoints-basename.rb +0 -2
  112. data/test/example/brkpt-class-bug.rb +0 -8
  113. data/test/example/classes.rb +0 -11
  114. data/test/example/dollar-0.rb +0 -6
  115. data/test/example/except-bug1.rb +0 -4
  116. data/test/example/file with space.rb +0 -1
  117. data/test/example/gcd.rb +0 -18
  118. data/test/example/info-var-bug.rb +0 -47
  119. data/test/example/info-var-bug2.rb +0 -2
  120. data/test/example/null.rb +0 -1
  121. data/test/example/output.rb +0 -2
  122. data/test/example/pm-bug.rb +0 -3
  123. data/test/example/pm.rb +0 -11
  124. data/test/example/raise.rb +0 -3
  125. data/test/gcd-dbg-nox.rb +0 -31
  126. data/test/gcd-dbg.rb +0 -30
  127. data/test/helper.rb +0 -167
  128. data/test/pm-base.rb +0 -22
  129. data/test/rdebug-save.1 +0 -7
  130. data/test/tdebug.rb +0 -252
  131. data/test/test-annotate.rb +0 -13
  132. data/test/test-at-exit.rb +0 -13
  133. data/test/test-break-bad.rb +0 -25
  134. data/test/test-breakpoints.rb +0 -24
  135. data/test/test-brkpt-class-bug.rb +0 -13
  136. data/test/test-catch.rb +0 -13
  137. data/test/test-condition.rb +0 -13
  138. data/test/test-ctrl.rb +0 -55
  139. data/test/test-display.rb +0 -14
  140. data/test/test-dollar-0.rb +0 -33
  141. data/test/test-edit.rb +0 -14
  142. data/test/test-emacs-basic.rb +0 -13
  143. data/test/test-enable.rb +0 -13
  144. data/test/test-except-bug1.rb +0 -16
  145. data/test/test-file-with-space.rb +0 -18
  146. data/test/test-finish.rb +0 -22
  147. data/test/test-frame.rb +0 -28
  148. data/test/test-help.rb +0 -60
  149. data/test/test-hist.rb +0 -64
  150. data/test/test-info-thread.rb +0 -24
  151. data/test/test-info-var.rb +0 -30
  152. data/test/test-info.rb +0 -27
  153. data/test/test-init.rb +0 -49
  154. data/test/test-list.rb +0 -14
  155. data/test/test-method.rb +0 -20
  156. data/test/test-output.rb +0 -13
  157. data/test/test-pm.rb +0 -37
  158. data/test/test-quit.rb +0 -13
  159. data/test/test-raise.rb +0 -13
  160. data/test/test-save.rb +0 -22
  161. data/test/test-setshow.rb +0 -13
  162. data/test/test-source.rb +0 -13
  163. data/test/test-stepping.rb +0 -14
  164. data/test/test-trace.rb +0 -40
  165. data/test/thread1.rb +0 -26
  166. data/test/trunc-call.rb +0 -31
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test annotate handling.
5
- class TestAnnotate < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname = 'annotate'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
data/test/test-at-exit.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test that it's possible to stop at breakpoints in an at_exit block.
5
- class TestAtExit < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname = 'at-exit'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/at-exit.rb"))
12
- end
13
- end
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test (mostly) invalid breakpoint commands
5
- class TestBadBreak < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname = 'break_bad'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
-
14
- def test_tracelines
15
- testname = 'break_tracelines'
16
- script = File.join('data', testname + '.cmd')
17
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
18
- end unless defined?(JRUBY_VERSION) # JRuby doesn't yet support tracelines
19
-
20
- def test_break_loop
21
- testname = 'break_loop_bug'
22
- script = File.join('data', testname + '.cmd')
23
- assert(run_debugger(testname, "--script #{script} -- ./example/bp_loop_issue.rb"))
24
- end
25
- end
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test breakpoint commands
5
- class TestBreakpoints < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='breakpoints'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
-
14
- def test_breakpoint_in_files_with_same_basename
15
- filter = proc do |got_lines, correct_lines|
16
- got_lines.each {|s| s.gsub!(/[^\s]*\/example\/(a|b)\/example.rb/, 'example/\1/example.rb') }
17
- end
18
-
19
- testname='breakpoints-basename'
20
- script = File.join('data', testname + '.cmd')
21
- assert(run_debugger(testname, "--script #{script} -- ./example/#{testname}.rb",
22
- :filter => filter))
23
- end
24
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test (mostly) invalid breakpoint commands
5
- class TestBrkptClassBug < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='brkpt-class-bug'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/brkpt-class-bug.rb"))
12
- end
13
- end
data/test/test-catch.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test condition command
5
- class TestCatch < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='catch'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/pm.rb"))
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test condition command
5
- class TestCondition < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='condition'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
data/test/test-ctrl.rb DELETED
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # begin require 'rubygems' rescue LoadError end
4
- # require 'ruby-debug' ; Debugger.start
5
-
6
- require 'test/unit'
7
- SRC_DIR = File.dirname(__FILE__) unless
8
- defined?(SRC_DIR)
9
- %w(ext lib cli).each do |dir|
10
- $: << File.join(SRC_DIR, '..', dir)
11
- end
12
- require 'ruby_debug'
13
- require File.join(SRC_DIR, '..', 'cli', 'ruby-debug')
14
-
15
- # Test Local Control Interface
16
- class TestCtrl < Test::Unit::TestCase
17
-
18
- def cheap_diff(got_lines, correct_lines, outfile)
19
- if correct_lines.size != got_lines.size
20
- puts "Size difference #{correct_lines.size} vs. #{got_lines.size}"
21
- File.open(outfile, 'w') {|f| f.puts got_lines}
22
- return false
23
- end
24
- correct_lines.each_with_index do |line, i|
25
- correct_lines[i].chomp!
26
- if got_lines[i] != correct_lines[i]
27
- puts "difference found at line #{i+1}"
28
- puts "got : #{got_lines[i]}"
29
- puts "need: #{correct_lines[i]}"
30
- File.open(outfile, 'w') {|f| f.puts got_lines}
31
- return false
32
- end
33
- end
34
- end
35
-
36
- require 'stringio'
37
-
38
- # Test initial variables and setting/getting state.
39
- def test_ctrl
40
- ENV['COLUMNS'] = '80'
41
- ENV['EMACS'] = nil
42
- testbase = 'ctrl'
43
- out = StringIO.new('', 'w')
44
- Dir.chdir(SRC_DIR) do
45
- script = File.join('data', "#{testbase}.cmd")
46
- interface = Debugger::ScriptInterface.new(script, out)
47
- processor = Debugger::ControlCommandProcessor.new(interface)
48
- processor.process_commands
49
- got_lines = out.string.split("\n")
50
- right_file = File.join('data', "#{testbase}.right")
51
- correct_lines = File.readlines(right_file)
52
- assert cheap_diff(got_lines, correct_lines, "#{testbase}.out")
53
- end
54
- end
55
- end
data/test/test-display.rb DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test Display commands
5
- class TestDisplay < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test commands in display.rb
9
- def test_basic
10
- testname='display'
11
- script = File.join('data', testname + '.cmd')
12
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
13
- end
14
- end
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test --no-stop and $0 setting.
5
- class TestDollar0 < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- home_save = ENV['HOME']
10
- ENV['HOME'] = '.'
11
- filter = Proc.new{|got_lines, correct_lines|
12
- [got_lines, correct_lines].flatten.each do |s|
13
- s.gsub!(/.*dollar-0.rb$/, 'dollar-0.rb')
14
- end
15
- }
16
-
17
- assert(run_debugger('dollar-0', '-nx --no-stop ./example/dollar-0.rb',
18
- :filter => filter,
19
- :runner => '../bin/rdebug'))
20
-
21
- # Ruby's __FILE__ seems to prepend ./ when no directory was added.
22
- assert(run_debugger('dollar-0a', '-nx --no-stop ./example/dollar-0.rb',
23
- :filter => filter,
24
- :runner => '../bin/rdebug'))
25
-
26
- # Ruby's __FILE__ seems to prepend ./ when no directory was added.
27
- assert(run_debugger('dollar-0b', '-nx --no-stop ' + File.join(%w(example dollar-0.rb)),
28
- :filter => filter,
29
- :runner => '../bin/rdebug'))
30
- ensure
31
- ENV['HOME'] = home_save
32
- end
33
- end
data/test/test-edit.rb DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test 'edit' command handling.
5
- class TestEdit < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='edit'
10
- script = File.join('data', testname + '.cmd')
11
- ENV['EDITOR']='echo FAKE-EDITOR '
12
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
13
- end
14
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test the --emacs-basic option.
5
- class TestEmacsBasic < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='emacs_basic'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--emacs-basic --script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
data/test/test-enable.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test enable and disable commands
5
- class TestEnable < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='enable'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Bug in Post-mortem command was not being able to show
5
- # variables on stack when stack stopped in a FIXNUM from 1/0.
6
- class TestExceptBug1 < Test::Unit::TestCase
7
- include TestHelper
8
-
9
- # Test post-mortem handling
10
- def test_pm_except_bug
11
- ENV['COLUMNS'] = '80'
12
- testname='except-bug1'
13
- script = File.join('data', testname + '.cmd')
14
- assert(run_debugger(testname, "--script #{script} --post-mortem ./example/#{testname}.rb"))
15
- end
16
- end unless defined?(JRUBY_VERSION) # post-mortem not yet supported on JRuby
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test Running a program wiht an embedded space
5
- class TestFileWithSpace < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='file-with-space'
10
- script = File.join('data', testname + '.cmd')
11
- # filter = Proc.new{|got_lines, correct_lines|
12
- # [got_lines[0], correct_lines[0]].each do |s|
13
- # s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
14
- # end
15
- # }
16
- assert(run_debugger(testname, "--script #{script} -- './example/file with space.rb'"))
17
- end
18
- end
data/test/test-finish.rb DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test finish command
5
- class TestFinish < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- # Ruby 1.8.6 and earlier have a trace-line number bug for return
10
- # statements.
11
- # filter = Proc.new{|got_lines, correct_lines|
12
- # [got_lines[31], got_lines[34]].flatten.each do |s|
13
- # s.sub!(/gcd.rb:\d+/, 'gcd.rb:13')
14
- # end
15
- # got_lines[32] = 'return a'
16
- # }
17
-
18
- testname = 'finish'
19
- script = File.join('data', testname + '.cmd')
20
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
21
- end
22
- end
data/test/test-frame.rb DELETED
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test frame commands
5
- class TestFrame < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test commands in frame.rb
9
- def test_basic
10
- testname='frame'
11
- script = File.join('data', testname + '.cmd')
12
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
13
- end
14
-
15
- def test_bad_continue
16
- # Remove absolute paths in output.
17
- filter = Proc.new{|got_lines, correct_lines|
18
- [got_lines, correct_lines].flatten.each do |s|
19
- s.sub!(/in file ".*gcd.rb/, 'in file "gcd.rb')
20
- end
21
- }
22
-
23
- testname='continue_bad'
24
- script = File.join('data', testname + '.cmd')
25
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
26
- :filter => filter))
27
- end unless defined?(JRUBY_VERSION) # JRuby doesn't yet support tracelines
28
- end
data/test/test-help.rb DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # begin require 'rubygems' rescue LoadError end
4
- # require 'ruby-debug' ; Debugger.start
5
-
6
- require 'test/unit'
7
- SRC_DIR = File.dirname(__FILE__) unless
8
- defined?(SRC_DIR)
9
- %w(ext lib cli).each do |dir|
10
- $:.unshift File.join(SRC_DIR, '..', dir)
11
- end
12
- require 'ruby_debug'
13
-
14
- require File.join(SRC_DIR, '..', 'cli', 'ruby-debug')
15
- $:.shift; $:.shift; $:.shift
16
-
17
- def cheap_diff(got_lines, correct_lines)
18
- puts got_lines if $DEBUG
19
- correct_lines.each_with_index do |line, i|
20
- correct_lines[i].chomp!
21
- if got_lines[i] != correct_lines[i]
22
- puts "difference found at line #{i+1}"
23
- puts "got : #{got_lines[i]}"
24
- puts "need: #{correct_lines[i]}"
25
- return false
26
- end
27
- if correct_lines.size != got_lines.size
28
- puts("difference in number of lines: " +
29
- "#{correct_lines.size} vs. #{got_lines.size}")
30
- return false
31
- end
32
- return true
33
- end
34
- end
35
-
36
- # Test Help commands
37
- class TestHelp < Test::Unit::TestCase
38
- require 'stringio'
39
-
40
- # Test initial variables and setting/getting state.
41
- def test_basic
42
- testbase = 'help'
43
- op = StringIO.new('', 'w')
44
- Dir.chdir(SRC_DIR) do
45
- script = File.join('data', "#{testbase}.cmd")
46
- Debugger.const_set('Version', 'unit testing')
47
- Debugger.run_script(script, op)
48
- got_lines = op.string.split("\n")
49
- right_file = File.join('data', "#{testbase}.right")
50
- correct_lines = File.readlines(right_file)
51
- result = cheap_diff(got_lines, correct_lines)
52
- unless result
53
- puts '-' * 80
54
- puts got_lines
55
- puts '-' * 80
56
- end
57
- assert result
58
- end
59
- end
60
- end
data/test/test-hist.rb DELETED
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test history commands
5
-
6
- class TestHistory < Test::Unit::TestCase
7
-
8
- @@SRC_DIR = File.dirname(__FILE__) unless
9
- defined?(@@SRC_DIR)
10
-
11
- include TestHelper
12
-
13
- unless defined?(@@FILE_HISTORY)
14
- @@FILE_HISTORY = '.rdebug_hist'
15
- end
16
-
17
- def test_basic
18
- # FIXME: Disable for now.
19
- assert true, 'FIXME'
20
- return
21
-
22
- # Set up history file to read from.
23
- ENV['HOME']=@@SRC_DIR
24
- ENV['RDEBUG'] = nil
25
-
26
- debugger_commands = ['show commands',
27
- 'set history save on',
28
- 'show history',
29
- 'quit unconditionally']
30
- debugger_output = 'test-history.out'
31
-
32
- Dir.chdir(@@SRC_DIR) do
33
- correct_lines = File.read(File.join('data', 'history.right')).split(/\n/)
34
- f = File.open(@@FILE_HISTORY, 'w')
35
- correct_lines[0.. -(debugger_commands.length+1)].each do |line|
36
- f.puts line
37
- end
38
- f.close
39
-
40
- # Now that we've set up a history file, run the debugger
41
- # and check that it's reading that correctly.
42
- debug_pgm=File.join(%w(.. rdbg.rb))
43
- debugged=File.join(%w(. example gcd.rb))
44
- IO.popen("#{debug_pgm} #{debugged} 3 5 >#{debugger_output}", 'w') do
45
- |pipe|
46
- debugger_commands.each do |cmd|
47
- pipe.puts cmd
48
- end
49
- end
50
-
51
- # Compare output
52
- got_lines = File.read(@@FILE_HISTORY).split(/\n/)
53
- if cheap_diff(got_lines, correct_lines)
54
- assert true
55
- FileUtils.rm(debugger_output)
56
- FileUtils.rm(@@FILE_HISTORY)
57
- else
58
- assert nil, 'Output differs'
59
- end
60
- end
61
- end
62
- end
63
-
64
-