diff options
author | Karl Williamson <khw@cpan.org> | 2018-04-08 14:40:49 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-04-17 11:31:05 -0600 |
commit | 346f9bfbe12d91fec534d97f05ab9e7f5a8b8230 (patch) | |
tree | 9e2010b9836913b36c4489af2c2d41451dce610f /lib/unicore | |
parent | 2b3e8a9185222124e75e2fb7227b1ce63b41e6cd (diff) | |
download | perl-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/unicore')
-rw-r--r-- | lib/unicore/mktables | 18 |
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 |