From: Jarkko Hietaniemi Date: Sun, 11 May 2003 07:53:26 +0000 (+0000) Subject: Test _getcode(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d782915283e79abc8a89d4bd0d3f0ae9357b87bb;p=p5sagit%2Fp5-mst-13.2.git Test _getcode(). p4raw-id: //depot/perl@19482 --- diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t index 9887637..4d952df 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)");