perl 5.003_06: pod/perlcall.pod pod/perldata.pod pod/perldebug.pod pod/perlembed...
[p5sagit/p5-mst-13.2.git] / t / cmd / mod.t
CommitLineData
8d063cd8 1#!./perl
2
79072805 3# $RCSfile: mod.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:11 $
8d063cd8 4
1aec8766 5print "1..11\n";
8d063cd8 6
7print "ok 1\n" if 1;
8print "not ok 1\n" unless 1;
9
10print "ok 2\n" unless 0;
11print "not ok 2\n" if 0;
12
131 && (print "not ok 3\n") if 0;
141 && (print "ok 3\n") if 1;
150 || (print "not ok 4\n") if 0;
160 || (print "ok 4\n") if 1;
17
18$x = 0;
19do {$x[$x] = $x;} while ($x++) < 10;
20if (join(' ',@x) eq '0 1 2 3 4 5 6 7 8 9 10') {
21 print "ok 5\n";
22} else {
79072805 23 print "not ok 5 @x\n";
8d063cd8 24}
25
26$x = 15;
27$x = 10 while $x < 10;
28if ($x == 15) {print "ok 6\n";} else {print "not ok 6\n";}
a687059c 29
2b17841a 30open(foo,'./TEST') || open(foo,'TEST') || open(foo,'t/TEST');
a687059c 31$x = 0;
32$x++ while <foo>;
33print $x > 50 && $x < 1000 ? "ok 7\n" : "not ok 7\n";
1aec8766 34
35$x = -0.5;
36print "not " if scalar($x) < 0 and $x >= 0;
37print "ok 8\n";
38
39print "not " unless (-(-$x) < 0) == ($x < 0);
40print "ok 9\n";
41
42print "ok 10\n" if $x < 0;
43print "not ok 10\n" unless $x < 0;
44
45print "ok 11\n" unless $x > 0;
46print "not ok 11\n" if $x > 0;
47