This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 1.0 patch 14: a2p incorrectly translates 'for (a in b)' construct.
[perl5.git] / t / op.do
CommitLineData
8d063cd8
LW
1#!./perl
2
3# $Header: op.do,v 1.0 87/12/18 13:13:20 root Exp $
4sub foo1
5{
6 print $_[0];
7 'value';
8}
9
10sub foo2
11{
12 shift(_);
13 print $_[0];
14 $x = 'value';
15 $x;
16}
17
18print "1..8\n";
19
20$_[0] = "not ok 1\n";
21$result = do foo1("ok 1\n");
22print "#2\t:$result: eq :value:\n";
23if ($result EQ 'value') { print "ok 2\n"; } else { print "not ok 2\n"; }
24if ($_[0] EQ "not ok 1\n") { print "ok 3\n"; } else { print "not ok 3\n"; }
25
26$_[0] = "not ok 4\n";
27$result = do foo2("not ok 4\n","ok 4\n","not ok 4\n");
28print "#5\t:$result: eq :value:\n";
29if ($result EQ 'value') { print "ok 5\n"; } else { print "not ok 5\n"; }
30if ($_[0] EQ "not ok 4\n") { print "ok 6\n"; } else { print "not ok 6\n"; }
31
32$result = do{print "ok 7\n"; 'value';};
33print "#8\t:$result: eq :value:\n";
34if ($result EQ 'value') { print "ok 8\n"; } else { print "not ok 8\n"; }