perl 5.0 alpha 3
[p5sagit/p5-mst-13.2.git] / t / op / time.t
CommitLineData
8d063cd8 1#!./perl
2
79072805 3# $RCSfile: time.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:32 $
8d063cd8 4
5print "1..5\n";
6
7($beguser,$begsys) = times;
8
9$beg = time;
10
11while (($now = time) == $beg) {}
12
13if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
14
15for ($i = 0; $i < 100000; $i++) {
16 ($nowuser, $nowsys) = times;
17 $i = 200000 if $nowuser > $beguser && $nowsys > $begsys;
18 last if time - $beg > 20;
19}
20
21if ($i >= 200000) {print "ok 2\n";} else {print "not ok 2\n";}
22
23($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($beg);
24($xsec,$foo) = localtime($now);
25$localyday = $yday;
26
135863df 27if ($sec != $xsec && $mday && $year)
8d063cd8 28 {print "ok 3\n";}
29else
30 {print "not ok 3\n";}
31
32($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
33($xsec,$foo) = localtime($now);
34
135863df 35if ($sec != $xsec && $mday && $year)
8d063cd8 36 {print "ok 4\n";}
37else
38 {print "not ok 4\n";}
39
40if (index(" :0:1:-1:365:366:-365:-366:",':' . ($localyday - $yday) . ':') > 0)
41 {print "ok 5\n";}
42else
43 {print "not ok 5\n";}