perl 2.0 patch 1: removed redundant debugging code in regexp.c
[p5sagit/p5-mst-13.2.git] / t / cmd.elsif
CommitLineData
8d063cd8 1#!./perl
2
378cc40b 3# $Header: cmd.elsif,v 2.0 88/06/05 00:12:16 root Exp $
8d063cd8 4
5sub foo {
6 if ($_[0] == 1) {
7 1;
8 }
9 elsif ($_[0] == 2) {
10 2;
11 }
12 elsif ($_[0] == 3) {
13 3;
14 }
15 else {
16 4;
17 }
18}
19
20print "1..4\n";
21
22if (($x = do foo(1)) == 1) {print "ok 1\n";} else {print "not ok 1\n";}
23if (($x = do foo(2)) == 2) {print "ok 2\n";} else {print "not ok 2\n";}
24if (($x = do foo(3)) == 3) {print "ok 3\n";} else {print "not ok 3\n";}
25if (($x = do foo(4)) == 4) {print "ok 4\n";} else {print "not ok 4\n";}