summaryrefslogtreecommitdiff
path: root/t/op/pack.t
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-10-06 10:22:10 -0600
committerKarl Williamson <khw@cpan.org>2015-10-08 12:51:10 -0600
commitca1146733aee7a7e26f418470b6b322615265631 (patch)
tree90098308b8e962d612dd1f20b94231a4bf4165cd /t/op/pack.t
parent45a23732c73c80f49ab3dcbcbfc7ccc88aa98065 (diff)
downloadperl-ca1146733aee7a7e26f418470b6b322615265631.tar.gz
t/op/pack.t: Clarify comment; change variable name
The variable is really the bytes that compose the utf8, not the utf8. Make the name clearer.
Diffstat (limited to 't/op/pack.t')
-rw-r--r--t/op/pack.t17
1 files changed, 9 insertions, 8 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index 1b0fd0dee8..b33b8fb449 100644
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -1533,26 +1533,27 @@ is(unpack('c'), 65, "one-arg unpack (change #18751)"); # defaulting to $_
is(unpack("C0%128U", "abcd"), unpack("U0%128U", "abcd"), "checksum not overflowed");
}
-my $U_1FFC_utf8 = byte_utf8a_to_utf8n("\341\277\274");
+my $U_1FFC_bytes = byte_utf8a_to_utf8n("\341\277\274");
my $first_byte = ord uni_to_native("\341");
{
# U0 and C0 must be scoped
- my (@x) = unpack("a(U0)U", "b$U_1FFC_utf8");
+ my (@x) = unpack("a(U0)U", "b$U_1FFC_bytes");
is($x[0], 'b', 'before scope');
is($x[1], 8188, 'after scope');
- is(pack("a(U0)U", "b", 8188), "b$U_1FFC_utf8");
+ is(pack("a(U0)U", "b", 8188), "b$U_1FFC_bytes");
}
SKIP:
{
# counted length prefixes shouldn't change C0/U0 mode
- # (note the length is actually 0 in this test)
- is(join(',', unpack("aC/UU", "b\0$U_1FFC_utf8")), 'b,8188');
- is(join(',', unpack("aC/CU", "b\0$U_1FFC_utf8")), 'b,8188');
+ # (note the length is actually 0 in this test, as the C/ is replaced by C0
+ # due to the \0 in the string)
+ is(join(',', unpack("aC/UU", "b\0$U_1FFC_bytes")), 'b,8188');
+ is(join(',', unpack("aC/CU", "b\0$U_1FFC_bytes")), 'b,8188');
skip "These two still fail on EBCDIC; investigate in v5.23", 2 if $::IS_EBCDIC;
- is(join(',', unpack("aU0C/UU", "b\0$U_1FFC_utf8")), "b,$first_byte");
- is(join(',', unpack("aU0C/CU", "b\0$U_1FFC_utf8")), "b,$first_byte");
+ is(join(',', unpack("aU0C/UU", "b\0$U_1FFC_bytes")), "b,$first_byte");
+ is(join(',', unpack("aU0C/CU", "b\0$U_1FFC_bytes")), "b,$first_byte");
}
{