diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Unicode/UCD.pm | 13 | ||||
-rw-r--r-- | lib/Unicode/UCD.t | 3 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index b15b9274cc..30acd503b8 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -530,13 +530,12 @@ sub charblock { my $code = _getcode($arg); if (defined $code) { - _search(\@BLOCKS, 0, $#BLOCKS, $code); - } else { - if (exists $BLOCKS{$arg}) { - return dclone $BLOCKS{$arg}; - } else { - return; - } + my $result = _search(\@BLOCKS, 0, $#BLOCKS, $code); + return $result if defined $result; + return 'No_Block'; + } + elsif (exists $BLOCKS{$arg}) { + return dclone $BLOCKS{$arg}; } } diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t index 00697512ba..9c57f384d1 100644 --- a/lib/Unicode/UCD.t +++ b/lib/Unicode/UCD.t @@ -17,7 +17,7 @@ use strict; use Unicode::UCD; use Test::More; -BEGIN { plan tests => 270 }; +BEGIN { plan tests => 271 }; use Unicode::UCD 'charinfo'; @@ -219,6 +219,7 @@ use Unicode::UCD qw(charblock charscript); is(charblock(0x590), 'Hebrew', '0x0590 - Hebrew unused charblock'); is(charscript(0x590), 'Unknown', '0x0590 - Hebrew unused charscript'); +is(charblock(0x1FFFF), 'No_Block', '0x1FFFF - unused charblock'); $charinfo = charinfo(0xbe); |