summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTon Hospel <perl5-porters@ton.iguana.be>2005-01-29 12:54:34 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-02-02 19:50:53 +0000
commit21c16052ffb70c4bff066e455c6d4bea74622e34 (patch)
treeb2b575ba0a4d46b84ab8494e3b47ce3aa747888c /t
parent0c81e54bc30e3e0dec16be656a10a6c616817930 (diff)
downloadperl-21c16052ffb70c4bff066e455c6d4bea74622e34.tar.gz
Re: encoding neutral unpack
From: perl5-porters[at]ton.iguana.be (Ton Hospel) Message-ID: <ctg12a$j0e$2[at]post.home.lunix> Counted length prefixes shouldn't change C0/U0 mode in pack/unpack (plus a regression test) p4raw-id: //depot/perl@23924
Diffstat (limited to 't')
-rwxr-xr-xt/op/pack.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index 701b7b0579..e51cc47ade 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -12,7 +12,7 @@ my $no_endianness = $] > 5.009 ? '' :
my $no_signedness = $] > 5.009 ? '' :
"Signed/unsigned pack modifiers not available on this perl";
-plan tests => 13859;
+plan tests => 13863;
use strict;
use warnings;
@@ -1509,3 +1509,12 @@ is(unpack('c'), 65, "one-arg unpack (change #18751)"); # defaulting to $_
is($x[0], 'b', 'before scope');
is($x[1], 225, 'after scope');
}
+
+{
+ # 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\341\277\274")), 'b,225');
+ is(join(',', unpack("aC/CU", "b\0\341\277\274")), 'b,225');
+ is(join(',', unpack("aU0C/UU", "b\0\341\277\274")), 'b,8188');
+ is(join(',', unpack("aU0C/CU", "b\0\341\277\274")), 'b,8188');
+}