summaryrefslogtreecommitdiff
path: root/t/cmd
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-05-10 12:24:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-10 12:24:06 +0000
commit4bfc3f4d8a75856264074036f844c7b83264858a (patch)
tree264b95ae149831ac56b8be8803df41ecfd254c8e /t/cmd
parentb8e103fca6fa9c2611b91a6bfdd4418dd57da243 (diff)
downloadperl-4bfc3f4d8a75856264074036f844c7b83264858a.tar.gz
Add a for(func()) test.
p4raw-id: //depot/perl@10069
Diffstat (limited to 't/cmd')
-rwxr-xr-xt/cmd/for.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/cmd/for.t b/t/cmd/for.t
index d70af579fc..90b5ff0b4f 100755
--- a/t/cmd/for.t
+++ b/t/cmd/for.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..10\n";
+print "1..11\n";
for ($i = 0; $i <= 10; $i++) {
$x[$i] = $i;
@@ -55,3 +55,14 @@ sub foo {
print foo(1) == 1 ? "ok" : "not ok", " 8\n";
print foo(2) == 2 ? "ok" : "not ok", " 9\n";
print foo(5) == 5 ? "ok" : "not ok", " 10\n";
+
+sub bar {
+ return (1, 2, 4);
+}
+
+$a = 0;
+foreach $b (bar()) {
+ $a += $b;
+}
+print $a == 7 ? "ok" : "not ok", " 11\n";
+