test/jump_test.rb in debugger-1.4.0 vs test/jump_test.rb in debugger-1.5.0

- old
+ new

@@ -7,15 +7,28 @@ it "must jump with absolute line number" do enter 'break 6', 'cont', "jump 8 #{fullpath('jump')}" debug_file('jump') { state.line.must_equal 8 } end + describe "jumping to the same line" do + it "must jump to the same line" do + enter 'break 6', 'cont', "jump 6 #{fullpath('jump')}" + debug_file('jump') { state.line.must_equal 6 } + end + + it "must show show the same position" do + enter 'break 6', 'cont', "jump 6 #{fullpath('jump')}" + debug_file('jump') + check_output_includes "#{fullpath('jump')}:6\nb = 3" + end + end + it "must not initialize skipped variables during jump" do enter 'break 6', 'cont', "jump 8 #{fullpath('jump')}", 'next' enter 'var local' debug_file('jump') - check_output_includes "a => 2", "b => nil", "c => nil", "d => 5" + check_output_includes /a = 2\nb = nil\nc = nil\nd = 5\ne = nil\nf = nil/ end it "must jump with relative line number (-)" do enter 'break 8', 'cont', "jump -2 #{fullpath('jump')}" debug_file('jump') { state.line.must_equal 6 } @@ -23,10 +36,16 @@ it "must jump with relative line number (+)" do enter 'break 8', 'cont', "jump +2 #{fullpath('jump')}" debug_file('jump') { state.line.must_equal 10 } end + + it "must show message after jump" do + enter 'break 6', 'cont', "jump 8 #{fullpath('jump')}" + debug_file('jump') + check_output_includes "#{fullpath('jump')}:8\nd = 5" + end end describe "errors" do it "must show an error if line number is invalid" do enter 'jump bla' @@ -35,10 +54,10 @@ end it "must show an error if line number is not specified" do enter 'jump' debug_file('jump') - check_output_includes '"jump" must be followed by a line number', interface.error_queue + check_output_includes "'jump' must be followed by a line number", interface.error_queue end describe "when there is no active code in specified line" do it "must not jump to there" do enter "jump 13 #{fullpath('jump')}"