Sha256: c8bab48721e361b9b8761e5986ea094085e1476c4e86d0fe722f1d2cdb843024

Contents?: true

Size: 1.2 KB

Versions: 35

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env ruby
require File.expand_path("helper", File.dirname(__FILE__))

# Some tests of Debugger module in C extension ruby_debug
class TestBreakpoints < Test::Unit::TestCase
  def test_find
    Debugger.start
    Debugger.add_breakpoint("foo.rb", 11, nil)
    assert_not_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "foo.rb", 11, nil))
    assert_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "bar.rb", 11, nil))
    assert_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "foo.rb", 10, nil))
  end

  def test_conditional_true_expression
    Debugger.start
    Debugger.add_breakpoint("foo.rb", 11, "[1, 2, 3].length == 3")
    assert_not_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "foo.rb", 11, nil))
    Debugger.stop
  end

  def test_conditional_false_expression
    Debugger.start
    Debugger.add_breakpoint("foo.rb", 11, "(2 + 2) == 5")
    assert_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "foo.rb", 11, nil))
    Debugger.stop
  end

  def test_conditional_undefined_variable
    Debugger.start
    Debugger.add_breakpoint("foo.rb", 11, "this_variable_does_not_exist")
    assert_nil(Debugger::Breakpoint.find(Debugger.breakpoints, "foo.rb", 11, nil))
    Debugger.stop
  end
end

Version data entries

35 entries across 24 versions & 3 rubygems

Version Path
debase-0.2.7 test/test_breakpoints.rb
debase-0.2.6 test/test_breakpoints.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/test/test_breakpoints.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.5.beta1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/debase-0.2.5.beta1/test/test_breakpoints.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb
debase-0.2.5.beta2 test/test_breakpoints.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/test_breakpoints.rb