From: SADAHIRO Tomoyuki Date: Tue, 28 May 2002 23:53:39 +0000 (+0900) Subject: Bug fix for charnames::vianame X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51b0dbc48c4f735e936ea3d667a53d6e4cc53951;p=p5sagit%2Fp5-mst-13.2.git Bug fix for charnames::vianame Message-Id: <20020528234907.310A.BQW10602@nifty.com> p4raw-id: //depot/perl@16837 --- diff --git a/lib/charnames.pm b/lib/charnames.pm index a540d14..af33c86 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 218cd9a..cfe7642 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";