summaryrefslogtreecommitdiff
path: root/lib/perl5db/t
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@cpan.org>2012-09-04 22:40:38 -0400
committerRicardo Signes <rjbs@cpan.org>2012-09-04 22:41:31 -0400
commit2c247e84d4c0ff4b5c5fe6c10b3257c55520332a (patch)
tree9df4b56199c4dd7a060490a6c594bc9666603bdd /lib/perl5db/t
parent32050a639a295d8d8a4d4c664592c86f79aa1383 (diff)
downloadperl-2c247e84d4c0ff4b5c5fe6c10b3257c55520332a.tar.gz
perl5db: more tests
This patch adds more tests for lib/perl5db.pl on lib/perl5db.t. One note is that I'm a bit uncomfortable about the test for ".", which did not initially work exactly as I expected, due to debugger quirks. This patch also fixes a bug where the /pattern/ command (and possibly the ?pattern? command as well) got broken due to the addition of "use strict;", and adds tests for them.
Diffstat (limited to 'lib/perl5db/t')
-rw-r--r--lib/perl5db/t/test-l-statement-112
-rw-r--r--lib/perl5db/t/test-l-statement-224
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/perl5db/t/test-l-statement-1 b/lib/perl5db/t/test-l-statement-1
index c3cf5b080e..990a169503 100644
--- a/lib/perl5db/t/test-l-statement-1
+++ b/lib/perl5db/t/test-l-statement-1
@@ -6,3 +6,15 @@ print "2\n";
$x = 3;
print "3\n";
+
+$x = 4;
+print "4\n";
+
+$x = 5;
+print "5\n";
+
+$x = 6;
+print "6\n";
+
+$x = 7;
+print "7\n";
diff --git a/lib/perl5db/t/test-l-statement-2 b/lib/perl5db/t/test-l-statement-2
new file mode 100644
index 0000000000..9e6a2105e9
--- /dev/null
+++ b/lib/perl5db/t/test-l-statement-2
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+sub fact {
+ my $n = shift;
+ if ($n > 1) {
+ return $n * fact($n - 1);
+ } else {
+ return 1;
+ }
+}
+
+sub bar {
+ print "One\n";
+ print "Two\n";
+ print "Three\n";
+
+ return;
+}
+
+fact(5);
+bar();