diff options
author | Karl Williamson <khw@cpan.org> | 2014-05-26 20:34:06 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-05-31 10:08:19 -0600 |
commit | 6deb7a5e3707524fd23c0080d6a762ff30e50494 (patch) | |
tree | 7dbc0f10f4184d131c021750cb3cda92c6a5f741 /lib/charnames.t | |
parent | a08d8f37be94aca8ba15add2c576382bb9f818c4 (diff) | |
download | perl-6deb7a5e3707524fd23c0080d6a762ff30e50494.tar.gz |
Use already existing functions in some .t files
I invented 2 functions for use in .t files a while back that turn out to
be duplicates of (undocumented) functions that already existed suitable
for general use. This commit changes to use those general functions and
removes the copies from t/test.pl. (I plan to document these functions
later in 5.21.). This is in preparation for moving some similar
functions from t/test.pl to a newly created test tools file, as it turns
out that these functions are useful in .t files that don't use
t/test.pl, but instead, e.g., Test::More.
Diffstat (limited to 'lib/charnames.t')
-rw-r--r-- | lib/charnames.t | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index bf413a6bae..5629f3a83c 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -209,10 +209,10 @@ sub test_vianame ($$$) { use charnames ':full'; my $text = "\N{LATIN CAPITAL LETTER A WITH DIAERESIS}"; - is($text, latin1_to_native("\xc4"), 'Verify \N{} returns correct string under "no utf8"'); + is($text, chr utf8::unicode_to_native(0xc4), 'Verify \N{} returns correct string under "no utf8"'); # I'm not sure that this tests anything different from the above. - cmp_ok(ord($text), '==', ord(latin1_to_native("\xc4")), '... and ords are ok'); + cmp_ok(ord($text), '==', utf8::unicode_to_native(0xc4), '... and ords are ok'); } { @@ -279,7 +279,7 @@ is("\N{LINE FEED (LF)}", "\n", 'Verify "\N{LINE FEED (LF)}" eq "\n"'); is("\N{LINE FEED}", "\n", 'Verify "\N{LINE FEED}" eq "\n"'); is("\N{LF}", "\n", 'Verify "\N{LF}" eq "\n"'); -my $nel = latin1_to_native("\x85"); +my $nel = chr utf8::unicode_to_native(0x85); $nel = qr/^$nel$/; like("\N{NEXT LINE (NEL)}", $nel, 'Verify "\N{NEXT LINE (NEL)}" is correct'); |