diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | lib/perl5db.t | 28 | ||||
-rw-r--r-- | lib/perl5db/t/test-dieLevel-option-1 | 22 |
3 files changed, 50 insertions, 1 deletions
@@ -4336,6 +4336,7 @@ lib/perl5db/t/source-cmd-test-no-q.perldb TTests for the Perl debugger lib/perl5db/t/source-cmd-test.perldb TTests for the Perl debugger lib/perl5db/t/symbol-table-bug Tests for the Perl debugger lib/perl5db/t/taint Tests for the Perl debugger +lib/perl5db/t/test-dieLevel-option-1 Tests for the Perl debugger lib/perl5db/t/test-l-statement-1 Tests for the Perl debugger lib/perl5db/t/test-l-statement-2 Tests for the Perl debugger lib/perl5db/t/test-m-statement-1 Tests for the Perl debugger diff --git a/lib/perl5db.t b/lib/perl5db.t index 87256b39b8..26cdeafe79 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -28,7 +28,7 @@ BEGIN { } } -plan(90); +plan(91); my $rc_filename = '.perldb'; @@ -2149,6 +2149,32 @@ sub _calc_trace_wrapper 'Test the o recallCommand option', ); } + +# Test the dieLevel option +{ + my $wrapper = DebugWrap->new( + { + cmds => + [ + q/o dieLevel='1'/, + q/c/, + 'q', + ], + prog => '../lib/perl5db/t/test-dieLevel-option-1', + } + ); + + $wrapper->output_like(qr# + ^This\ program\ dies\.\ at\ \S+\ line\ 18\.\n + .*? + ^\s+main::baz\(\)\ called\ at\ \S+\ line\ 13\n + \s+main::bar\(\)\ called\ at\ \S+\ line\ 7\n + \s+main::foo\(\)\ called\ at\ \S+\ line\ 21\n + #msx, + 'Test the o dieLevel option', + ); +} + END { 1 while unlink ($rc_filename, $out_fn); } diff --git a/lib/perl5db/t/test-dieLevel-option-1 b/lib/perl5db/t/test-dieLevel-option-1 new file mode 100644 index 0000000000..0849ae2a0d --- /dev/null +++ b/lib/perl5db/t/test-dieLevel-option-1 @@ -0,0 +1,22 @@ +use strict; +use warnings; + +sub foo +{ + print "In foo\n"; + bar(); +} + +sub bar +{ + print "In baz\n"; + baz(); +} + +sub baz +{ + die "This program dies."; +} + +foo(); + |