This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/fold_grind.pl: Enhance to deal with Turkic rules
[perl5.git] / lib / perl5db.t
index 98a3686..3d432ad 100644 (file)
@@ -10,6 +10,8 @@ use strict;
 use warnings;
 use Config;
 
+delete $ENV{PERLDB_OPTS};
+
 BEGIN {
     if (! -c "/dev/null") {
         print "1..0 # Skip: no /dev/null\n";
@@ -29,7 +31,7 @@ BEGIN {
     $ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu
 }
 
-plan(121);
+plan(127);
 
 my $rc_filename = '.perldb';
 
@@ -2769,7 +2771,7 @@ SKIP:
     );
 
     $wrapper->output_like(
-        qr/No manual entry for perlrules/,
+        qr/No (?:manual )?entry for perlrules/,
         'perldoc command works fine',
     );
 }
@@ -2799,6 +2801,106 @@ SKIP:
     );
 }
 
+{
+    # perl 5 RT #126735 regression bug.
+    local $ENV{PERLDB_OPTS} = "NonStop=0 RemotePort=non-existent-host.tld:9001";
+    my $output = runperl( stdin => "q\n", stderr => 1, switches => [ '-d' ], prog => '../lib/perl5db/t/fact' );
+    like(
+        $output,
+        qr/^Unable to connect to remote host:/ms,
+        'Tried to connect.',
+    );
+    unlike(
+        $output,
+        qr/syntax error/,
+        'Can quit from the debugger after a wrong RemotePort',
+    );
+}
+
+{
+    # perl 5 RT #120174 - 'p' command
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'b 2',
+                'c',
+                'p@abc',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/rt-120174',
+        }
+    );
+
+    $wrapper->contents_like(
+        qr/1234/,
+        q/RT 120174: p command can be invoked without space after 'p'/,
+    );
+}
+
+{
+    # perl 5 RT #120174 - 'x' command on array
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'b 2',
+                'c',
+                'x@abc',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/rt-120174',
+        }
+    );
+
+    $wrapper->contents_like(
+        qr/0\s+1\n1\s+2\n2\s+3\n3\s+4/ms,
+        q/RT 120174: x command can be invoked without space after 'x' before array/,
+    );
+}
+
+{
+    # perl 5 RT #120174 - 'x' command on array ref
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'b 2',
+                'c',
+                'x\@abc',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/rt-120174',
+        }
+    );
+
+    $wrapper->contents_like(
+        qr/\s+0\s+1\n\s+1\s+2\n\s+2\s+3\n\s+3\s+4/ms,
+        q/RT 120174: x command can be invoked without space after 'x' before array ref/,
+    );
+}
+
+{
+    # perl 5 RT #120174 - 'x' command on hash ref
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'b 4',
+                'c',
+                'x\%xyz',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/rt-120174',
+        }
+    );
+
+    $wrapper->contents_like(
+        qr/\s+'alpha'\s+=>\s+'beta'\n\s+'gamma'\s+=>\s+'delta'/ms,
+        q/RT 120174: x command can be invoked without space after 'x' before hash ref/,
+    );
+}
+
 END {
     1 while unlink ($rc_filename, $out_fn);
 }