Sha256: e8a94c792c28b1120d445985002906d161d96ebe11dda3b1ac76c7238dceaeaf

Contents?: true

Size: 1.44 KB

Versions: 9

Compression:

Stored size: 1.44 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'
require 'rubygems'; require 'require_relative'
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'] * 4) + (%w(continue) * 4)).join("\n")
    line = __LINE__
    cmds = (cmds_pat % [line, line+6, 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',
           'Set breakpoint 1: foo.rb:55 (@3)',
           'Set breakpoint 2: foo.rb:55 (@3)',
           'Set breakpoint 3: foo.rb:55 (@3)',
           'Set breakpoint 4: foo.rb:55 (@3)',
           'xx ',
           'x = 11   # line + 11',
           'xx ',
           'b = 6      # line +  6',
           'xx ',
           'c = 14     # line + 14'
          ]
    compare_output(out, d, cmds)
  end

end


Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rbx-trepanning-0.1.0-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.7-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.6-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.5-universal-rubinius-1.2.1 test/functional/test-break.rb
rbx-trepanning-0.0.4-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.3-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.2-universal-rubinius-1.2 test/functional/test-break.rb
rbx-trepanning-0.0.1-universal-rubinius test/functional/test-break.rb