Sha256: 352fe1d97fd3522b3e870ba4c4a705a4d2c067027f0ff0bc979677acd47b5cbe

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'
require_relative 'fn_helper'

class TestBreak < Test::Unit::TestCase

  include FnTestHelper

  def test_line_only_break
    # Check that we can set breakpoints in parent, sibling and children
    # of sibling returns. We have one more 'continue' than we need
    # just in case something goes wrong.
    cmds_pat = ((['break %d'] * 3) + (%w(continue) * 4)).join("\n")
    line = __LINE__
    cmds = (cmds_pat % [line, line+11, line+14]).split(/\n/)
    d = strarray_setup(cmds)
    ##############################
    def foo      # line +  4  
      a = 5      # line +  5
      b = 6      # line +  6
    end          # line +  7
    1.times do   # line +  8 
      d.start    # line +  9
      1.times do # line + 10
        x = 11   # line + 11
        foo      # line + 12
      end        # line + 13
      c = 14     # line + 14
    end
    ##############################
    d.stop # ({:remove => true})
    out = ["-- ",
           "1.times do # line + 10",
           "Breakpoint 1 set at VM offset 55 of instruction sequence \"test_line_only_break\",
\tline 55 in file foo.rb",
           "Breakpoint 2 set at VM offset 55 of instruction sequence \"block (2 levels) in test_line_only_break\",
\tline 55 in file foo.rb",
           "Breakpoint 3 set at VM offset 55 of instruction sequence \"block in test_line_only_break\",
\tline 55 in file foo.rb",
           "xx ",
           "x = 11   # line + 11",
           "xx ",
           "c = 14     # line + 14"]
    compare_output(out, d, cmds)
  end

end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trepanning-1.93.35 test/functional/test-break.rb
trepanning-1.93.32 test/functional/test-break.rb
trepanning-0.1.6 test/functional/test-break.rb
trepanning-0.1.4 test/functional/test-break.rb
trepanning-0.1.3 test/functional/test-break.rb
trepanning-0.1.2 test/functional/test-break.rb
trepanning-0.1.1 test/functional/test-break.rb