Sha256: 0b67e9dc8b6ef26559c6fcb113b2fbb06e6b6a0f85ff4f0623f2e7196a716c36

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

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

def discontinuous(obj)
  if klass = obj.class and klass.kind_of?(String)
    return true
  end
  return nil
end

class TestNextBug < Test::Unit::TestCase

  include FnTestHelper

  # Sometimes a line may have a disconnected set of IP. For example
  # Rubinius::VariableScope#method_visibility which has these
  # offset/lines
  #
  # ... 0, 126, 22, 127, 29, 128, 43, 130, 48, 126, 50, ...
  #        ^^^                                 ^^^
  #
  # Make sure when can "next" when we are stopped at the 2nd part of
  # line 126 (offset 50). 
  # 
  def test_next_on_line_with_discontinuous_ips
    lines = method(:discontinuous).executable.lines
    unless lines.at(3) == lines.at(7) 
      puts("Skipping #{__FILE__} test because code generated is not " +
           "what we need to test here. Please fix.")
    end
    cmds = %w(step next continue)
    d = strarray_setup(cmds)
    d.start
    discontinuous(4)
    d.stop
    out = ['-- ',
           'discontinuous(4)',
           '-> ',
           'if klass = obj.class and klass.kind_of?(String)',
           '-- ',
           'return nil'
          ]
    compare_output(out, d, cmds)
  end
end


Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 test/functional/test-next-bug.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 test/functional/test-next-bug.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.7-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.6-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.5-universal-rubinius-1.2.1 test/functional/test-next-bug.rb
rbx-trepanning-0.0.4-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.3-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.2-universal-rubinius-1.2 test/functional/test-next-bug.rb
rbx-trepanning-0.0.1-universal-rubinius test/functional/test-next-bug.rb