#!/usr/bin/env ruby
require 'test/unit'
require 'trace'
require_relative 'fn_helper'
require_relative %w(.. .. app brkpt)

class TestDelete < Test::Unit::TestCase

  include FnTestHelper

  def setup
    Breakpoint::reset
  end

  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 28
	in file test-delete.rb,
	VM 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 2', 
            '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.',
           'autoeval is on.',
           'Breakpoint 2 set at line 56
	in file test-delete.rb,
	VM offset 55 of instruction sequence test_delete.',
           'Breakpoint 3 set at line 58
	in file test-delete.rb,
	VM offset 55 of instruction sequence test_delete.',
           'Deleted breakpoint 2',
           'xx vd = 4',
           '3'
          ]
    compare_output(out, d, cmds)

  end
    
end


Add first delete functional test.
Add first delete functional test.
