summaryrefslogtreecommitdiff
path: root/lib/Unicode
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-05-11 07:53:26 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-05-11 07:53:26 +0000
commitd782915283e79abc8a89d4bd0d3f0ae9357b87bb (patch)
tree7bed3a7c8f506db6f529b8d9391f1b60386b6e95 /lib/Unicode
parentdc0a4417816de4de16d412283906a2a3c2bbce9b (diff)
downloadperl-d782915283e79abc8a89d4bd0d3f0ae9357b87bb.tar.gz
Test _getcode().
p4raw-id: //depot/perl@19482
Diffstat (limited to 'lib/Unicode')
-rw-r--r--lib/Unicode/UCD.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t
index 9887637f72..4d952df646 100644
--- a/lib/Unicode/UCD.t
+++ b/lib/Unicode/UCD.t
@@ -12,7 +12,7 @@ use strict;
use Unicode::UCD;
use Test::More;
-BEGIN { plan tests => 164 };
+BEGIN { plan tests => 176 };
use Unicode::UCD 'charinfo';
@@ -287,5 +287,15 @@ ok(1, 'compexcl read-only $_: perl #7305');
grep {compexcl $_} %{{1=>2}};
ok(1, 'compexcl read-only hash: perl #7305');
-
-
+is(Unicode::UCD::_getcode('123'), 123, "_getcode(123)");
+is(Unicode::UCD::_getcode('0123'), 0x123, "_getcode(0123)");
+is(Unicode::UCD::_getcode('0x123'), 0x123, "_getcode(0x123)");
+is(Unicode::UCD::_getcode('0X123'), 0x123, "_getcode(0X123)");
+is(Unicode::UCD::_getcode('U+123'), 0x123, "_getcode(U+123)");
+is(Unicode::UCD::_getcode('u+123'), 0x123, "_getcode(u+123)");
+is(Unicode::UCD::_getcode('U+1234'), 0x1234, "_getcode(U+1234)");
+is(Unicode::UCD::_getcode('U+12345'), 0x12345, "_getcode(U+12345)");
+is(Unicode::UCD::_getcode('123x'), undef, "_getcode(123x)");
+is(Unicode::UCD::_getcode('x123'), undef, "_getcode(x123)");
+is(Unicode::UCD::_getcode('0x123x'), undef, "_getcode(x123)");
+is(Unicode::UCD::_getcode('U+123x'), undef, "_getcode(x123)");