Sha256: c846fc6d3074ef7e33f7289809cfe2988fb709e6f658695a5e92b164876cba59

Contents?: true

Size: 559 Bytes

Versions: 11

Compression:

Stored size: 559 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'ruby-debug'

class TestCatchCommand < Test::Unit::TestCase

  class MockState
    attr_accessor :message
    def context; end
    def confirm(msg); true end
    def print(*args)
      @message = *args
    end
  end

  # regression test for bug #20156
  def test_catch_does_not_blow_up
    state = MockState.new
    catch_cmd = Debugger::CatchCommand.new(state)
    assert(catch_cmd.match('catch off'))
    catch(:debug_error) do
      catch_cmd.execute
    end
    assert_equal(nil, state.message)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
debugger-1.2.4 test/lib/commands/catchpoint_test.rb
debugger-1.2.3 test/lib/commands/catchpoint_test.rb
debugger-1.2.2 test/lib/commands/catchpoint_test.rb
debugger-1.2.1 test/lib/commands/catchpoint_test.rb
debugger-1.2.0 test/lib/commands/catchpoint_test.rb
debugger-1.1.4 test/lib/commands/catchpoint_test.rb
debugger-1.1.3 test/lib/commands/catchpoint_test.rb
debugger-1.1.2 test/lib/commands/catchpoint_test.rb
debugger-1.1.1 test/lib/commands/catchpoint_test.rb
debugger-1.1.0 test/lib/commands/catchpoint_test.rb
debugger-1.0.1 test/lib/commands/catchpoint_test.rb