Sha256: 50df070a50cae2cc9916248cde7b718b665470b5b4b49376f781020c79dae5d4

Contents?: true

Size: 1.8 KB

Versions: 3

Compression:

Stored size: 1.8 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'
require 'trace'
require_relative 'fn_helper'
require_relative '../../app/breakpoint'

class TestDelete < Test::Unit::TestCase

  include FnTestHelper

  def test_delete

    # See that when we can delete a breakpoint.
    cmds = ['set basename on',
            'break ' + (__LINE__ + 9).to_s, 
            'delete 1', 
            'continue',
           ]
    d = strarray_setup(cmds)
    d.start
    ########### b1 ###############
    va = 1
    vb = 2
    vc = 3
    vd = 4
    ve = 5
    ##############################
    d.stop
    out = ['-- ',
           'va = 1',
           'basename is on.',
           "Breakpoint 1 set at line 55 in file foo.rb,\n\tVM offset 55 of instruction sequence \"test_delete\".",
           "Deleted breakpoint 1."]
    compare_output(out, d, cmds)

    # See that when we can delete a breakpoint but get to the next one.
    cmds = ['set basename on',
            'set autoeval on',
            'break ' + (__LINE__ + 11).to_s, 
            'break ' + (__LINE__ + 12).to_s, 
            'delete 1', 
            'continue',
            'va',
            'continue',
           ]
    d = strarray_setup(cmds)
    d.start
    ########### b1 ###############
    va = 1
    vb = 2
    va = 3
    vd = 4
    ve = 5
    ##############################
    d.stop
    out = ["-- ",
           "va = 1",
           "basename is on.",
           "Evaluation of unrecognized debugger commands is on.",
           "Breakpoint 1 set at line 55 in file foo.rb,
\tVM offset 55 of instruction sequence \"test_delete\".",
           "Breakpoint 2 set at line 55 in file foo.rb,
\tVM offset 55 of instruction sequence \"test_delete\".",
           "Deleted breakpoint 1.",
           "xx ",
           "vd = 4",
           "D=> 3"]
    compare_output(out, d, cmds)

  end
    
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trepanning-0.1.0 test/functional/test-delete.rb
trepanning-0.0.9 test/functional/test-delete.rb
trepanning-0.0.8 test/functional/test-delete.rb