diff options
author | Ton Hospel <perl5-porters@ton.iguana.be> | 2005-03-12 18:54:29 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-03-12 22:05:14 +0000 |
commit | f7f98fdfea717e6de174a9b8b95e1c18726eb5f3 (patch) | |
tree | 04c5b3fe6418195fb7bf721e0ef4258402b883e2 /t/op/pack.t | |
parent | fc241834abbeaa1671255ad773a79b564c8d9607 (diff) | |
download | perl-f7f98fdfea717e6de174a9b8b95e1c18726eb5f3.tar.gz |
Re: Encoding neutral unpack
Message-ID: <d0vdt5$81a$1@post.home.lunix>
A new test.
p4raw-id: //depot/perl@24031
Diffstat (limited to 't/op/pack.t')
-rwxr-xr-x | t/op/pack.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/pack.t b/t/op/pack.t index 7f6bbed31b..06c3a9a475 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 => 14604; +plan tests => 14606; use strict; use warnings; @@ -1495,6 +1495,18 @@ is(unpack('c'), 65, "one-arg unpack (change #18751)"); # defaulting to $_ is($a[-2], "X", "[perl #15288]"); } +{ + my $warning; + local $SIG{__WARN__} = sub { + $warning = $_[0]; + }; + my $out = pack("u99", "foo" x 99); + like($warning, qr/Field too wide in 'u' format in pack at /, + "Warn about too wide uuencode"); + is($out, ("_" . "9F]O" x 21 . "\n") x 4 . "M" . "9F]O" x 15 . "\n", + "Use max width in case of too wide uuencode"); +} + # checksums { # verify that unpack advances correctly wrt a checksum |