summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2011-12-10 16:17:04 +0200
committerRicardo Signes <rjbs@cpan.org>2011-12-30 11:54:45 -0500
commit984e0ec49a7acf38f8a849fbdd1773d17a7ff559 (patch)
tree7054a81592f47401d91fcec3829d4ba9ba4364c6
parent7f92e913a723c2bba1f19d536a5e9d2d6cbc9d2a (diff)
downloadperl-984e0ec49a7acf38f8a849fbdd1773d17a7ff559.tar.gz
Add a test for the debugger p command.
-rw-r--r--lib/perl5db.t23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/perl5db.t b/lib/perl5db.t
index 0a5de2e343..3b7c8bb76a 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -28,7 +28,7 @@ BEGIN {
}
}
-plan(22);
+plan(23);
my $rc_filename = '.perldb';
@@ -502,6 +502,27 @@ EOF
"Prompt should display the line of code inside a subroutine.");
}
+# Checking that the p command works.
+{
+ rc(<<'EOF');
+&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
+
+sub afterinit {
+ push (@DB::typeahead,
+ 'p "<<<" . (4*6) . ">>>"',
+ 'q',
+ );
+
+}
+EOF
+
+ my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => '../lib/perl5db/t/with-subroutine');
+
+ like(_out_contents(),
+ qr/<<<24>>>/,
+ "p command works.");
+}
+
END {
1 while unlink ($rc_filename, $out_fn);
}