Skip to content

Commit 7d43273

Browse files
committed
Unit test for new error condition
In response to Tony's review in GH Perl#23301
1 parent 879c350 commit 7d43273

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Unicode/UCD.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,13 @@ is($ret_len, 5, "... and the returned length is 5");
834834
ok(! defined num("98765\N{FULLWIDTH DIGIT FOUR}", \$ret_len),
835835
'Verify num("98765\N{FULLWIDTH DIGIT FOUR}") isnt defined');
836836
is($ret_len, 5, "... but the returned length is 5");
837+
{
838+
local $@;
839+
my $ret_len = [ 5 ];
840+
eval { num("98765", \$ret_len); };
841+
like($@, qr/::num: second parameter must be a scalar reference/,
842+
"num: Incorrect type for second parameter; must be scalar ref");
843+
}
837844
my $tai_lue_2;
838845
if ($v_unicode_version ge v4.1.0) {
839846
my $tai_lue_1 = charnames::string_vianame("NEW TAI LUE DIGIT ONE");

0 commit comments

Comments
 (0)