fold_grind.t: Add testing of multi-char folds in pattern
authorKarl Williamson <public@khwilliamson.com>
Mon, 9 May 2011 14:57:29 +0000 (08:57 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 19 May 2011 16:31:19 +0000 (10:31 -0600)
Previously these were skipped.  Now skip just the ones that don't make
sense or aren't implemented.

t/re/fold_grind.t

index 0e482de..930b0ee 100644 (file)
@@ -443,9 +443,6 @@ foreach my $test (sort { numerically } keys %tests) {
             run_test($eval, ++$count, "", "");
           }
 
-          # XXX Doesn't currently test multi-char folds in pattern
-          next if @pattern != 1;
-
           # See if works on what could be a simple trie.
           $eval = "my \$c = \"$lhs\"; my \$p = qr/$rhs|xyz/i$charset;$upgrade_target$upgrade_pattern \$c $op \$p";
           run_test($eval, ++$count, "", "");
@@ -454,6 +451,8 @@ foreach my $test (sort { numerically } keys %tests) {
           my $this_iteration = 0;
 
           foreach my $bracketed (0, 1) {   # Put rhs in [...], or not
+            next if $bracketed && @pattern != 1;    # bracketed makes these
+                                                    # or's instead of a sequence
             foreach my $inverted (0,1) {
                 next if $inverted && ! $bracketed;  # inversion only valid in [^...]
                 next if $inverted && @target != 1;  # [perl #89750] multi-char
@@ -492,6 +491,10 @@ foreach my $test (sort { numerically } keys %tests) {
                                         : "((${rhs})+,?)";
                     foreach my $quantifier ("", '?', '*', '+', '{1,3}') {
 
+                      # Perhaps should be TODOs, as are unimplemented, but
+                      # maybe will never be implemented
+                      next if @pattern != 1 && $quantifier;
+
                       # A ? or * quantifier normally causes the thing to be
                       # able to match a null string
                       my $quantifier_can_match_null = $quantifier eq '?' || $quantifier eq '*';