summaryrefslogtreecommitdiff
path: root/t/op.list
diff options
context:
space:
mode:
Diffstat (limited to 't/op.list')
-rw-r--r--t/op.list36
1 files changed, 30 insertions, 6 deletions
diff --git a/t/op.list b/t/op.list
index 1dee724cde..02eb0f4007 100644
--- a/t/op.list
+++ b/t/op.list
@@ -1,13 +1,13 @@
#!./perl
-# $Header: op.list,v 2.0 88/06/05 00:14:09 root Exp $
+# $Header: op.list,v 3.0 89/10/18 15:29:44 lwall Locked $
-print "1..18\n";
+print "1..27\n";
@foo = (1, 2, 3, 4);
if ($foo[0] == 1 && $foo[3] == 4) {print "ok 1\n";} else {print "not ok 1\n";}
-$_ = join(foo,':');
+$_ = join(':',@foo);
if ($_ eq '1:2:3:4') {print "ok 2\n";} else {print "not ok 2\n";}
($a,$b,$c,$d) = (1,2,3,4);
@@ -17,7 +17,7 @@ if ("$a;$b;$c;$d" eq '1;2;3;4') {print "ok 3\n";} else {print "not ok 3\n";}
if ("$a;$b;$c" eq '333;222;111') {print "ok 4\n";} else {print "not ok 4\n";}
($a,$b,$c) = ($c,$b,$a);
-if ("$a;$b;$c" eq '111;222;333') {print "ok 5\n";} else {print "not ok 5\n";}
+if ("$a;$b;$c" eq '111;222;333') {print "ok 5\n";} else {print "not ok 5 $a;$b;$c\n";}
($a, $b) = ($b, $a);
if ("$a;$b;$c" eq '222;111;333') {print "ok 6\n";} else {print "not ok 6\n";}
@@ -33,8 +33,8 @@ if ($d eq 4) {print "ok 10\n";} else {print "not ok 10\n";}
print "#11 $a;$b;$c;$d eq 1;2;3;4\n";
if ("$a;$b;$c;$d" eq '1;2;3;4') {print "ok 11\n";} else {print "not ok 11\n";}
-@foo = (1);
-if (join(':',@foo) eq '1') {print "ok 12\n";} else {print "not ok 12\n";}
+@foo = @bar = (1);
+if (join(':',@foo,@bar) eq '1:1') {print "ok 12\n";} else {print "not ok 12\n";}
@foo = ();
@foo = 1+2+3;
@@ -57,3 +57,27 @@ if (join('',@a) eq '123') {print "ok 17\n";} else {print "not ok 17\n";}
@a = ($x == $x || (4,5,6));
if (join('',@a) eq '1') {print "ok 18\n";} else {print "not ok 18\n";}
+
+if (join('',1,2,(3,4,5)) eq '12345'){print "ok 19\n";}else{print "not ok 19\n";}
+if (join('',(1,2,3,4,5)) eq '12345'){print "ok 20\n";}else{print "not ok 20\n";}
+if (join('',(1,2,3,4),5) eq '12345'){print "ok 21\n";}else{print "not ok 21\n";}
+if (join('',1,(2,3,4),5) eq '12345'){print "ok 22\n";}else{print "not ok 22\n";}
+if (join('',1,2,(3,4),5) eq '12345'){print "ok 23\n";}else{print "not ok 23\n";}
+if (join('',1,2,3,(4),5) eq '12345'){print "ok 24\n";}else{print "not ok 24\n";}
+
+for ($x = 0; $x < 3; $x++) {
+ ($a, $b, $c) = do {
+ if ($x == 0) {
+ ('ok ', 25, "\n");
+ }
+ elsif ($x == 1) {
+ ('ok ', 26, "\n");
+ }
+ else {
+ ('ok ', 27, "\n");
+ }
+ };
+
+ print $a,$b,$c;
+}
+