Integrate changes #9675,9676 from maintperl into mainline.
[p5sagit/p5-mst-13.2.git] / t / op / pat.t
index c3024a2..9cd6e9d 100755 (executable)
@@ -5,7 +5,7 @@
 # that does fit that format, add it to op/re_tests, not here.
 
 $| = 1;
-print "1..581\n";
+print "1..586\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -1547,3 +1547,28 @@ print "ok 247\n";
 
     print "ok 581\n";
 }
+
+{
+    # bugid 20010410.006
+    for my $rx (
+               '/(.*?)\{(.*?)\}/csg',
+               '/(.*?)\{(.*?)\}/cg',
+               '/(.*?)\{(.*?)\}/sg',
+               '/(.*?)\{(.*?)\}/g',
+               '/(.+?)\{(.+?)\}/csg',
+              )
+    {
+       my($input, $i);
+
+       $i = 0;
+       $input = "a{b}c{d}";
+        eval <<EOT;
+       while (eval \$input =~ $rx) {
+           print "# \\\$1 = '\$1' \\\$2 = '\$2'\n";
+           ++\$i;
+       }
+EOT
+       print "not " unless $i == 2;
+       print "ok " . $test++ . "\n";
+    }
+}