diff options
author | David Cantrell <david@cantrell.org.uk> | 2022-01-26 23:33:45 +0000 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-02-13 13:58:15 -0700 |
commit | 1050ad29160d5692f1e52dfdc4fe4750d97f2301 (patch) | |
tree | 65fcefa7199fed4646b970b60b3098e1ca7eb72f /lib | |
parent | 212e06a685d29b993f82ff26541245a56d56d182 (diff) | |
download | perl-1050ad29160d5692f1e52dfdc4fe4750d97f2301.tar.gz |
tests to detect when the user asks for short names for multiple
charsets which have letters with the same name
Diffstat (limited to 'lib')
-rw-r--r-- | lib/charnames.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index b641d3c233..7639cdd8f7 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -201,6 +201,30 @@ sub test_vianame ($$$) { } { + my $caught_error; + local $SIG{__WARN__} = sub { $caught_error = shift; }; + eval q{ + use charnames qw(runic greek); + is($caught_error, undef, "no letter name clashes between runic and greek"); + }; +} + +{ + my $caught_error; + local $SIG{__WARN__} = sub { $caught_error = shift; }; + eval q{ + use charnames qw(hebrew arabic :full); + like( + $caught_error, + qr/charnames: some short character names may clash in \[ARABIC, HEBREW\], for example ALEF/, + "warned about potential character name clashes" + ); + ok("\N{bet}" eq "\N{HEBREW LETTER BET}", 'despite that, \N{bet} gives HEBREW LETTER BET'); + ok("\N{sheen}" eq "\N{ARABIC LETTER SHEEN}", 'and \N{sheen} gives ARABIC LETTER SHEEN'); + }; +} + +{ use charnames ':full'; is("\x{263a}", "\N{WHITE SMILING FACE}", 'Verify "\x{263a}" eq "\N{WHITE SMILING FACE}"'); cmp_ok(length("\x{263a}"), '==', 1, 'Verify length of \x{263a} is 1'); |