diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2002-05-29 08:53:39 +0900 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-28 14:06:42 +0000 |
commit | 51b0dbc48c4f735e936ea3d667a53d6e4cc53951 (patch) | |
tree | 61caf266c25c9278120e16af06418513c61219ad /lib | |
parent | 7d63dedd4e5d9316e3ff452dfadcf0da5248c852 (diff) | |
download | perl-51b0dbc48c4f735e936ea3d667a53d6e4cc53951.tar.gz |
Bug fix for charnames::vianame
Message-Id: <20020528234907.310A.BQW10602@nifty.com>
p4raw-id: //depot/perl@16837
Diffstat (limited to 'lib')
-rw-r--r-- | lib/charnames.pm | 2 | ||||
-rw-r--r-- | lib/charnames.t | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/charnames.pm b/lib/charnames.pm index a540d14f7f..af33c86abc 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -235,7 +235,7 @@ sub vianame $txt = do "unicore/Name.pl" unless $txt; - if ($txt =~ m/^([0-9A-F]+)\t\t($arg)/m) { + if ($txt =~ m/^([0-9A-F]+)\t\t($arg)$/m) { return $vianame{$arg} = hex $1; } else { return; diff --git a/lib/charnames.t b/lib/charnames.t index 218cd9ad98..cfe7642a7c 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -12,7 +12,7 @@ BEGIN { $| = 1; -print "1..44\n"; +print "1..46\n"; use charnames ':full'; @@ -144,7 +144,7 @@ sub to_bytes { { print "not " unless - sprintf "%04X\n", charnames::vianame("GOTHIC LETTER AHSA") eq "10330"; + sprintf("%04X", charnames::vianame("GOTHIC LETTER AHSA")) eq "10330"; print "ok 19\n"; print "not " if @@ -159,7 +159,7 @@ sub to_bytes { print "ok 21\n"; print "not " unless - sprintf "%04X\n", charnames::vianame("GOTHIC LETTER AHSA") eq "10330"; + sprintf("%04X", charnames::vianame("GOTHIC LETTER AHSA")) eq "10330"; print "ok 22\n"; } @@ -235,8 +235,18 @@ print "ok 41\n"; print "not " unless "\N{U+263A}" eq "\N{WHITE SMILING FACE}"; print "ok 42\n"; +{ + print "not " unless + 0x3093 == charnames::vianame("HIRAGANA LETTER N"); + print "ok 43\n"; + + print "not " unless + 0x0397 == charnames::vianame("GREEK CAPITAL LETTER ETA"); + print "ok 44\n"; +} + print "not " if defined charnames::viacode(0x110000); -print "ok 43\n"; +print "ok 45\n"; print "not " if grep { /you asked for U+110000/ } @WARN; -print "ok 44\n"; +print "ok 46\n"; |