summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTon Hospel <perl5-porters@ton.iguana.be>2005-01-29 13:07:38 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-02-02 19:35:47 +0000
commit0c81e54bc30e3e0dec16be656a10a6c616817930 (patch)
tree6cd358bbcf60f75076fbebb595eb7d10c5cd5ece /t
parentd6d3e8bddad8c105fc1972d4d9a8298ad3f73f11 (diff)
downloadperl-0c81e54bc30e3e0dec16be656a10a6c616817930.tar.gz
Re: encoding neutral unpack
From: perl5-porters[at]ton.iguana.be (Ton Hospel) Message-ID: <ctg1qq$j0e$3[at]post.home.lunix> Make U0 and C0 scoped to () pack subtemplates. (plus a regression test) p4raw-id: //depot/perl@23923
Diffstat (limited to 't')
-rwxr-xr-xt/op/pack.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index 3fc4cfd740..701b7b0579 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 => 13857;
+plan tests => 13859;
use strict;
use warnings;
@@ -1502,3 +1502,10 @@ is(unpack('c'), 65, "one-arg unpack (change #18751)"); # defaulting to $_
# verify that the checksum is not overflowed with C0
is(unpack("C0%128U", "abcd"), unpack("U0%128U", "abcd"), "checksum not overflowed");
}
+
+{
+ # U0 and C0 must be scoped
+ my (@x) = unpack("a(U0)U", "b\341\277\274");
+ is($x[0], 'b', 'before scope');
+ is($x[1], 225, 'after scope');
+}