Skip to content

Commit fd9c3b2

Browse files
committed
perl5db.t: add a test for "b compile subname"
I've just been looking at the implementation, and there's no test, so add one.
1 parent 0b035da commit fd9c3b2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/perl5db.t

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,6 +3602,38 @@ EOS
36023602
"didn't run the wrong code");
36033603
}
36043604

3605+
{
3606+
my $wrapper = DebugWrap->new(
3607+
{
3608+
cmds =>
3609+
[
3610+
"b compile problem",
3611+
"L",
3612+
"c",
3613+
"q"
3614+
],
3615+
prog => \<<'EOS'
3616+
print "1\n";
3617+
eval <<'EOC';
3618+
sub problem {
3619+
$SIG{__DIE__} = sub {
3620+
die "<b problem> will set a break point here.\n";
3621+
}; # The break point _should_ be set here.
3622+
warn "This line will run even if you enter <c problem>.\n";
3623+
}
3624+
EOC
3625+
print "2\n";
3626+
problem();
3627+
print "3\n";
3628+
EOS
3629+
}
3630+
);
3631+
$wrapper->contents_like(qr/Postponed\ breakpoints\ in\ subroutines:
3632+
\s+main::problem\s+compile/x,
3633+
"check compiled breakpoint present");
3634+
$wrapper->contents_like(qr/print "2\\n"/, "break immediately after defining problem");
3635+
}
3636+
36053637
done_testing();
36063638

36073639
END {

0 commit comments

Comments
 (0)