summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-04-08 14:40:49 -0600
committerKarl Williamson <khw@cpan.org>2018-04-17 11:31:05 -0600
commit346f9bfbe12d91fec534d97f05ab9e7f5a8b8230 (patch)
tree9e2010b9836913b36c4489af2c2d41451dce610f /lib
parent2b3e8a9185222124e75e2fb7227b1ce63b41e6cd (diff)
downloadperl-346f9bfbe12d91fec534d97f05ab9e7f5a8b8230.tar.gz
mktables: Add tests for t/re/unipropsFOO
Make sure that a non-binary property doesn't get mistakenly matched in \p{}, which is only for binary ones. There are some ambiguities that this test keeps us from falling victim to.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 64a7bc6a1e..8d535152d8 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -19109,6 +19109,24 @@ EOF_CODE
lc $a->name cmp lc $b->name
} property_ref('*'))
{
+ # Non-binary properties should not match \p{}; Test all for that.
+ if ($property->type != $BINARY) {
+ my @property_aliases = grep { $_->status ne $INTERNAL_ALIAS }
+ $property->aliases;
+ foreach my $property_alias ($property->aliases) {
+ my $name = standardize($property_alias->name);
+
+ # But some names are ambiguous, meaning a binary property with
+ # the same name when used in \p{}, and a different
+ # (non-binary) property in other contexts.
+ next if grep { $name eq $_ } keys %ambiguous_names;
+
+ push @output, <<"EOF_CODE";
+Error('\\p{$name}');
+Error('\\P{$name}');
+EOF_CODE
+ }
+ }
foreach my $table (sort { $a->has_dependency <=> $b->has_dependency
or
lc $a->name cmp lc $b->name