1#!perl 2use strict; 3use warnings; 4use lib 'lib'; 5use Test::More tests => 9; 6use Devel::ebug; 7 8my $ebug = Devel::ebug->new; 9$ebug->program("corpus/calc.pl"); 10$ebug->load; 11 12# Let's step through the program, and check that we get the 13# correct subroutine for each line 14 15foreach (1..9) { 16 my $line = $ebug->line; 17 my $sub = $ebug->subroutine; 18 19 my $want_sub = 'main'; 20 # sub add { ... } is lines 11 to 15 21 if ($line > 11 && $line < 15) { 22 $want_sub = 'main::add'; 23 } 24 25 is($sub, $want_sub); 26 $ebug->step; 27} 28 29