perl -d: add test for the x command.
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 10 Dec 2011 15:23:04 +0000 (17:23 +0200)
committerRicardo Signes <rjbs@cpan.org>
Fri, 30 Dec 2011 16:54:45 +0000 (11:54 -0500)
lib/perl5db.t

index 3b7c8bb..d08323a 100644 (file)
@@ -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);
 }