From: Shlomi Fish Date: Sat, 10 Dec 2011 15:23:04 +0000 (+0200) Subject: perl -d: add test for the x command. X-Git-Tag: v5.15.7~396 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/9f810cd7bc6d908e8a5c28b2f8fecc244247e97f perl -d: add test for the x command. --- diff --git a/lib/perl5db.t b/lib/perl5db.t index 3b7c8bb..d08323a 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -28,7 +28,7 @@ BEGIN { } } -plan(23); +plan(24); my $rc_filename = '.perldb'; @@ -523,6 +523,29 @@ EOF "p command works."); } +# Tests for x. +{ + rc(<<'EOF'); +&parse_options("NonStop=0 TTY=db.out LineInfo=db.out"); + +sub afterinit { + push (@DB::typeahead, + q/x {500 => 600}/, + 'q', + ); + +} +EOF + + my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => '../lib/perl5db/t/with-subroutine'); + + like(_out_contents(), + # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/, + qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/ms, + "x command test." + ); +} + END { 1 while unlink ($rc_filename, $out_fn); }