This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
re/regexp_unicode_prop.t: Add test
authorKarl Williamson <khw@cpan.org>
Sun, 8 Apr 2018 21:03:56 +0000 (15:03 -0600)
committerKarl Williamson <khw@cpan.org>
Tue, 17 Apr 2018 17:41:06 +0000 (11:41 -0600)
User-defined properties can have the same name as, and override an
official property definition.  This may or may not be the correct
behavior going forward, but it shouldn't be changed inadvertently.

t/re/regexp_unicode_prop.t

index 1544482..42191df 100644 (file)
@@ -100,6 +100,9 @@ my @USER_DEFINED_PROPERTIES = (
    Dash                      => ['-'],
    ASCII_Hex_Digit           => ['!-', 'A'],
    IsAsciiHexAndDash         => ['-', 'A'],
+
+   # This overrides the official one
+   InLatin1                  => ['\x{0100}', '!\x{00FF}'],
 );
 
 my @USER_CASELESS_PROPERTIES = (
@@ -342,6 +345,10 @@ sub IsAsciiHexAndDash {<<'--'}
 +utf8::Dash
 --
 
+sub InLatin1 {
+    return "0100\t10FFFF";
+}
+
 sub IsMyUpper {
     my $caseless = shift;
     return "+utf8::"