summaryrefslogtreecommitdiff
path: root/t/op/pack.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-08-02 22:49:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-08-02 22:49:53 +0000
commitba1ac97691f605d2aaa9008a954c1aa8ac884815 (patch)
tree6ef4c606db84a7f13789a7a94eea0f9c8d18d534 /t/op/pack.t
parent01e4aa14c2f1b1acb8c9f4937a640ca107fbc0a6 (diff)
downloadperl-ba1ac97691f605d2aaa9008a954c1aa8ac884815.tar.gz
fix unpack('u',...) problem with spaces in input
p4raw-id: //depot/maint-5.005/perl@1715
Diffstat (limited to 't/op/pack.t')
-rwxr-xr-xt/op/pack.t10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index 02efb66717..c821ed6c04 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -161,16 +161,20 @@ foreach my $t (@templates) {
# 57..58: uuencode/decode
$in = join "", map { chr } 0..255;
+
+# just to be anal, we do some random tr/`/ /
$uu = <<'EOUU';
-M``$"`P0%!@<("0H+#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL
+M` $"`P0%!@<("0H+# T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL
M+2XO,#$R,S0U-C<X.3H[/#T^/T!!0D-$149'2$E*2TQ-3D]045)35%565UA9
M6EM<75Y?8&%B8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ>WQ]?G^`@8*#A(6&
MAXB)BHN,C8Z/D)&2DY25EI>8F9J;G)V>GZ"AHJ.DI::GJ*FJJZRMKJ^PL;*S
MM+6VM[BYNKN\O;Z_P,'"P\3%QL?(R<K+S,W.S]#1TM/4U=;7V-G:V]S=WM_@
-?X>+CY.7FY^CIZNOL[>[O\/'R\_3U]O?X^?K[_/W^_P``
+?X>+CY.7FY^CIZNOL[>[O\/'R\_3U]O?X^?K[_/W^_P `
EOUU
-print "not " unless pack('u', $in) eq $uu;
+$_ = $uu;
+tr/ /`/;
+print "not " unless pack('u', $in) eq $_;
print "ok ", $test++, "\n";
print "not " unless unpack('u', $uu) eq $in;