Sha256: 25a7cc9c43701c941abdaafe2b0a53752ade3fefd14297a7d63eb96e428ddbc1

Contents?: true

Size: 1.86 KB

Versions: 2

Compression:

Stored size: 1.86 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 #{__LINE__-8} in file test-delete.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 #{__LINE__-10} in file test-delete.rb,\n\tVM offset 55 of instruction sequence \"test_delete\".",
           "Breakpoint 2 set at line #{__LINE__-9} in file test-delete.rb,\n\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

2 entries across 2 versions & 1 rubygems

Version Path
trepanning-0.0.6 test/functional/test-delete.rb
trepanning-0.0.4 test/functional/test-delete.rb