diff options
author | Karl Williamson <khw@cpan.org> | 2020-05-12 22:18:54 -0600 |
---|---|---|
committer | Sawyer X <xsawyerx@cpan.org> | 2020-05-27 11:09:54 +0300 |
commit | a39c5dfbc6cedea1c77a56bd4e4febee38a812c1 (patch) | |
tree | 5f49d1efd203751b754f13f5ced6a34775d3faa0 /lib/charnames.t | |
parent | da3350397f4030c098c43eb8ce4ea964e886d2eb (diff) | |
download | perl-a39c5dfbc6cedea1c77a56bd4e4febee38a812c1.tar.gz |
charnames: Explicitly return undef for empty input
Rather it returns an empty list for undefined or zero width input names.
This fixes #17768
Diffstat (limited to 'lib/charnames.t')
-rw-r--r-- | lib/charnames.t | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index 26bd4464f8..01e1fd7d92 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -264,6 +264,11 @@ sub test_vianame ($$$) { cmp_ok($warning_count, '==', scalar @WARN, "Verify vianame doesn't warn on unknown names"); ok (! defined charnames::string_vianame("MORE NONE SUCH"), "Verify string_vianame returns undef for an undefined name"); cmp_ok($warning_count, '==', scalar @WARN, "Verify string_vianame doesn't warn on unknown names"); + ok (! defined charnames::vianame(""), "Verify vianame returns undef for an empty value"); + cmp_ok($warning_count, '==', scalar @WARN, "... and no warning is generated"); + ok (! defined charnames::string_vianame(""), "Verify string_vianame returns undef for an empty value"); + cmp_ok($warning_count, '==', scalar @WARN, "... and no warning is generated"); + eval "qr/\\p{name=MORE NONE SUCH}/"; like($@, qr/Can't find Unicode property definition "name=MORE NONE SUCH"/, '\p{name=} returns an appropriate error message on an undefined name'); |