summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-19 23:16:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-19 23:16:06 +0000
commitbf80f5a2c0a23d1b580bf7b35d9ad8d922d88ebd (patch)
treeded9f242c86aad9a4cb8ae24c12425dda0f78328 /t
parentf3298698649960f55687abba6097c0cc3538214a (diff)
downloadperl-bf80f5a2c0a23d1b580bf7b35d9ad8d922d88ebd.tar.gz
Unpack in scalar context should return the first value
returned in list context, as pointed out by Ton Hospel in 2001-05-21 (this is how it works already in blead, just adding the test). p4raw-id: //depot/perl@12515
Diffstat (limited to 't')
-rwxr-xr-xt/op/pack.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index f944aafab5..cfb55018e4 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -1,6 +1,6 @@
#!./perl -w
-print "1..611\n";
+print "1..613\n";
BEGIN {
chdir 't' if -d 't';
@@ -661,3 +661,13 @@ foreach (
my @u = unpack($t, $p);
ok(@u == 2 && $u[0] eq $u && $u[1] eq $v);
}
+
+{
+ # 612
+
+ ok((unpack("w/a*", "\x02abc"))[0] eq "ab");
+
+ # 613: "w/a*" should be seen as one unit
+
+ ok(scalar unpack("w/a*", "\x02abc") eq "ab");
+}