diff options
author | Shlomi Fish <shlomif@shlomifish.org> | 2011-12-13 18:41:32 +0200 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2011-12-30 11:54:46 -0500 |
commit | 65ab031493be42ff1395a14fbaf93ed836251d7a (patch) | |
tree | da989b2fe2c0877a6ad5a47f7af80f250f58ebcd /lib/perl5db.t | |
parent | 8fe891f14cf8b9cdf749846f93a001cb7fac3e40 (diff) | |
download | perl-65ab031493be42ff1395a14fbaf93ed836251d7a.tar.gz |
perl -d: add a test to the 's' command.
Conflicts:
lib/perl5db.t
Diffstat (limited to 'lib/perl5db.t')
-rw-r--r-- | lib/perl5db.t | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/lib/perl5db.t b/lib/perl5db.t index b9a806b76d..5c52a0e267 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -28,7 +28,7 @@ BEGIN { } } -plan(26); +plan(28); my $rc_filename = '.perldb'; @@ -610,6 +610,55 @@ EOF ); } +{ + rc(<<'EOF'); +&parse_options("NonStop=0 TTY=db.out LineInfo=db.out"); + +sub afterinit { + push (@DB::typeahead, + 'n', + 'n', + 'b . $exp > 200', + 'c', + q/print "Exp={$exp}\n";/, + 'q', + ); + +} +EOF + + my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => '../lib/perl5db/t/break-on-dot'); + + like($output, qr/ + Exp=\{256\} + /msx, + "'b .' is working correctly."); +} + +{ + rc(<<'EOF'); +&parse_options("NonStop=0 TTY=db.out LineInfo=db.out"); + +sub afterinit { + push (@DB::typeahead, + 's', + 'q', + ); + +} +EOF + + my $prog_fn = '../lib/perl5db/t/rt-104168'; + my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => $prog_fn,); + + like(_out_contents(), + qr/ + ^main::foo\([^\)\n]*\brt-104168:9\):[\ \t]*\n + ^9:\s*bar\(\); + /msx, + 'Test for the s command.', + ); +} + END { 1 while unlink ($rc_filename, $out_fn); } |