Re: [perl #34195] Regex: Alternations within negative lookahead assertions
[p5sagit/p5-mst-13.2.git] / t / op / regexp.t
index 4a4d42f..b4288b2 100755 (executable)
@@ -38,7 +38,7 @@ BEGIN {
 
 $iters = shift || 1;           # Poor man performance suite, 10000 is OK.
 
-open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests') ||
+open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests') || open(TESTS,':op:re_tests') ||
        die "Can't open re_tests";
 
 while (<TESTS>) { }
@@ -49,6 +49,7 @@ $. = 0;
 $bang = sprintf "\\%03o", ord "!"; # \41 would not be portable.
 $ffff  = chr(0xff) x 2;
 $nulnul = "\0" x 2;
+$OP = $qr ? 'qr' : 'm';
 
 $| = 1;
 print "1..$numtests\n# $iters iterations\n";
@@ -69,13 +70,11 @@ while (<TESTS>) {
     $expect =~ s/\\n/\n/g;
     $expect = $repl = '-' if $skip_amp and $input =~ /\$[&\`\']/;
     $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
-    # Certain tests don't work with utf8 (the re_test should be in UTF8)
-    $skip = 1, $reason = 'utf8'
-      if ($^H &= ~0x00000008) && $pat =~ /\[:\^(alnum|print|word|ascii|xdigit):\]/;
+    $reason = 'skipping $&' if $reason eq  '' && $skip_amp;
     $result =~ s/B//i unless $skip;
     for $study ('', 'study \$subject') {
        $c = $iters;
-       eval "$study; \$match = (\$subject =~ m$pat) while \$c--; \$got = \"$repl\";";
+       eval "$study; \$match = (\$subject =~ $OP$pat) while \$c--; \$got = \"$repl\";";
        chomp( $err = $@ );
        if ($result eq 'c') {
            if ($err !~ m!^\Q$expect!) { print "not ok $. (compile) $input => `$err'\n"; next TEST }