summaryrefslogtreecommitdiff
path: root/lib/perl5db.t
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2011-12-13 18:41:32 +0200
committerRicardo Signes <rjbs@cpan.org>2011-12-30 11:54:46 -0500
commit65ab031493be42ff1395a14fbaf93ed836251d7a (patch)
treeda989b2fe2c0877a6ad5a47f7af80f250f58ebcd /lib/perl5db.t
parent8fe891f14cf8b9cdf749846f93a001cb7fac3e40 (diff)
downloadperl-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.t51
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);
}