This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
re/uniprops: Fix to work on early Unicodes
authorKarl Williamson <khw@cpan.org>
Thu, 14 Jan 2016 16:15:13 +0000 (09:15 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 14 Jan 2016 17:49:11 +0000 (10:49 -0700)
The guts of this test are generated by mktables.  Commit
f1f6961f5a6fd77a3e3c36f242f1b72ce5dfe205 broke early Unicode versions
handling.

charclass_invlists.h
lib/unicore/mktables
regcharclass.h

index 868413c..edcba31 100644 (file)
@@ -74615,7 +74615,7 @@ static const UV XPosixXDigit_invlist[] = { /* for EBCDIC 037 */
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * 2b18fcfeafc8e8a26ff1124ad4ca94020f287bc4651be7ea199d69ecd5dcf9c5 lib/unicore/mktables
+ * cd8623059fc882357fcf6fdea363d1c927af6ad1506e5aea5d383070344183f6 lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * 214ab3909a11fcc57cb6ee0611897342109b5a895b2b42d5227b80d948744a0a regen/mk_invlists.pl
index 3e250aa..4297fcf 100644 (file)
@@ -19602,6 +19602,9 @@ if (defined &locales_enabled) {
     }
 }
 
+# Eval'd so can run on versions earlier than the property is available in
+my $WB_Extend_or_Format_re = eval 'qr/[\p{WB=Extend}\p{WB=Format}]/';
+
 sub _test_break($$) {
     # Test various break property matches.  The 2nd parameter gives the
     # property name.  The input is a line from auxiliary/*Test.txt for the
@@ -19639,7 +19642,7 @@ sub _test_break($$) {
     }
 
     # Perl customizes wb.  So change the official tests accordingly
-    if ($break_type eq 'wb') {
+    if ($break_type eq 'wb' && $WB_Extend_or_Format_re) {
 
         # Split into elements that alternate between code point and
         # break/no-break
@@ -19660,7 +19663,7 @@ sub _test_break($$) {
 
             # But, we want to make sure to test spaces followed by a Extend
             # or Format.
-            next if $rhs !~ /[\s\p{WB=Extend}\p{WB=Format}]/;
+            next if $rhs !~ /\s|$WB_Extend_or_Format_re/;
 
             # To test the customization, add some white-space before this to
             # create a span.  The $lhs white space may or may not be bound to
@@ -19671,7 +19674,7 @@ sub _test_break($$) {
             # $lhs
             my $bound;
             my $span;
-            if ($rhs =~ /[\p{WB=Extend}\p{WB=Format}]/) {
+            if ($rhs =~ /$WB_Extend_or_Format_re/) {
                 if ($lhs =~ /\v/) {
                     $bound = $breakable;
                     $span = $nobreak;
index 8eb7e06..7847239 100644 (file)
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * 2b18fcfeafc8e8a26ff1124ad4ca94020f287bc4651be7ea199d69ecd5dcf9c5 lib/unicore/mktables
+ * cd8623059fc882357fcf6fdea363d1c927af6ad1506e5aea5d383070344183f6 lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * d9c04ac46bdd81bb3e26519f2b8eb6242cb12337205add3f7cf092b0c58dccc4 regen/regcharclass.pl