This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test for the { and { ? commands.
authorShlomi Fish <shlomif@shlomifish.org>
Wed, 12 Sep 2012 07:47:19 +0000 (10:47 +0300)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:20 +0000 (09:18 -0500)
lib/perl5db.t

index 51b1cf0..81e04d3 100644 (file)
@@ -28,7 +28,7 @@ BEGIN {
     }
 }
 
-plan(74);
+plan(75);
 
 my $rc_filename = '.perldb';
 
@@ -1670,6 +1670,40 @@ package main;
     );
 }
 
+# Test the { ? and { [command] commands.
+{
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                q/{ ?/,
+                q/{ l/,
+                q/{ ?/,
+                q/b 5/,
+                q/c/,
+                q/q/,
+            ],
+            prog => '../lib/perl5db/t/disable-breakpoints-1',
+        }
+    );
+
+    $wrapper->contents_like(qr#
+        ^No\ pre-debugger\ actions\.\n
+        .*?
+        ^pre-debugger\ commands:\n
+        \s+\{\ --\ l\n
+        .*?
+        ^5==>b\s+\$x\ =\ "FirstVal";\n
+        6\s*\n
+        7:\s+\$dummy\+\+;\n
+        8\s*\n
+        9:\s+\$x\ =\ "SecondVal";\n
+
+        #msx,
+        'Test the pre-prompt debugger commands',
+    );
+}
+
 END {
     1 while unlink ($rc_filename, $out_fn);
 }