Skip to content

Commit

Permalink
perl5db.t: add a test for "b compile subname"
Browse files Browse the repository at this point in the history
I've just been looking at the implementation, and there's no
test, so add one.
  • Loading branch information
tonycoz committed Jul 16, 2024
1 parent fc1b978 commit 55eec59
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/perl5db.t
Original file line number Diff line number Diff line change
Expand Up @@ -3602,6 +3602,38 @@ EOS
"didn't run the wrong code");
}

{
my $wrapper = DebugWrap->new(
{
cmds =>
[
"b compile problem",
"L",
"c",
"q"
],
prog => \<<'EOS'
print "1\n";
eval <<'EOC';
sub problem {
$SIG{__DIE__} = sub {
die "<b problem> will set a break point here.\n";
}; # The break point _should_ be set here.
warn "This line will run even if you enter <c problem>.\n";
}
EOC
print "2\n";
problem();
print "3\n";
EOS
}
);
$wrapper->contents_like(qr/Postponed\ breakpoints\ in\ subroutines:
\s+main::problem\s+compile/x,
"check compiled breakpoint present");
$wrapper->contents_like(qr/print "2\\n"/, "break immediately after defining problem");
}

done_testing();

END {
Expand Down

0 comments on commit 55eec59

Please sign in to comment.