Code points that are not in a block are considered to be in the
pseudo-block 'No_Block' by the Unicode standard; so change to do that
instead of 'undef'
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};
}
}
use Unicode::UCD;
use Test::More;
-BEGIN { plan tests => 270 };
+BEGIN { plan tests => 271 };
use Unicode::UCD 'charinfo';
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);