reg_fold.t: Test bracketed character classes
authorKarl Williamson <public@khwilliamson.com>
Sun, 25 Dec 2011 21:35:54 +0000 (14:35 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 19 Jan 2012 18:58:20 +0000 (11:58 -0700)
These were removed when things were very broken, but now they work,
except for things like

    "\N{LATIN SMALL LIGATURE FFI}" =~ /[a-z]{3}/i

where the multi-char fold crosses single bracketed character class
boundaries.  These will probably never be fixed in Perl in the general
case (using \F and fc() instead), but I expect that

    "\N{LATIN SMALL LIGATURE FFI}" =~ /[f][f][i]/i

will eventually be changed so the brackets are optimized away, and will
work.  Then these TODOs will start passing.

t/re/reg_fold.t

index e8c6262..264b2fd 100644 (file)
@@ -24,7 +24,7 @@ while (<$fh>) {
     my $chr="\\x{$cp}";
     my @str;
     foreach my $swap (0, 1) {   # swap lhs and rhs, or not.
-        foreach my $charclass (0) {   # Put rhs in [...], or not
+        foreach my $charclass (0, 1) {   # Put rhs in [...], or not
             my $lhs;
             my $rhs;
             if ($swap) {
@@ -32,6 +32,7 @@ while (<$fh>) {
                 $rhs = $chr;
                 $rhs = "[$rhs]" if $charclass;
             } else {
+                #next if $charclass && @folded > 1;
                 $lhs = $chr;
                 $rhs = "";
                 foreach my $rhs_char (@folded) {