Change 12515 by jhi@alpha on 2001/10/19 23:16:06

        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).

Affected files ...

... //depot/perl/t/op/pack.t#48 edit

Differences ...

==== //depot/perl/t/op/pack.t#48 (xtext) ====
Index: perl/t/op/pack.t
--- perl/t/op/pack.t.~1~        Fri Oct 19 17:30:06 2001
+++ perl/t/op/pack.t    Fri Oct 19 17:30:06 2001
@@ -1,6 +1,6 @@
 #!./perl -w
 
-print "1..611\n";
+print "1..613\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -661,3 +661,13 @@
     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");
+}
End of Patch.

Reply via email to