This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Calculate \p{Assigned} earlier in build
[perl5.git] / t / re / reg_nocapture.t
index d2e2550..f354cea 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
 use strict;
 use warnings;
 
-plan tests => 21;
+plan tests => 25;
 
 # Some /qr/ tests
 my $re = qr/(.*) b c d/;
@@ -44,6 +44,22 @@ is($1, 'a', "named capture allows $1 with /n");
 is($2, 'b', "named capture allows $2 with /n");
 is($3, undef, "(.*) didn't capture with /n");
 
-is($+{a}, 'a', "\$+{a} is correct");
-is($+{b}, 'b', "\$+{b} is correct");
+SKIP: {
+    skip "no %+ under miniperl", 2 if is_miniperl();
+    no strict 'refs';
+    is(${"+"}{a}, 'a', "\$+{a} is correct");
+    is(${"+"}{b}, 'b', "\$+{b} is correct");
+}
+
+is(qr/(what)/n,     '(?^n:(what))',
+  'qr//n stringified is correct');
+
+is(qr/(?n:what)/,   '(?^:(?n:what))',
+  'qr/(?n:...)/ stringified is correct');
+
+is(qr/(?-n:what)/,  '(?^:(?-n:what))',
+  'qr/(?-n:...)/ stringified is correct');
+
+is(qr/(?-n:what)/n, '(?^n:(?-n:what))',
+  'qr/(?-n:...)/n stringified is correct');