This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test case for C<undef %File::Glob::>
[perl5.git]
/
t
/
op
/
time.t
diff --git
a/t/op/time.t
b/t/op/time.t
index
347592d
..
caf2c14
100755
(executable)
--- a/
t/op/time.t
+++ b/
t/op/time.t
@@
-2,19
+2,21
@@
# $RCSfile: time.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:32 $
# $RCSfile: time.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:32 $
-print "1..5\n";
+if ($does_gmtime = gmtime(time)) { print "1..6\n" }
+else { print "1..3\n" }
($beguser,$begsys) = times;
$beg = time;
($beguser,$begsys) = times;
$beg = time;
-while (($now = time) == $beg) {}
+while (($now = time) == $beg) {
sleep 1
}
if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
for ($i = 0; $i < 100000; $i++) {
($nowuser, $nowsys) = times;
if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
for ($i = 0; $i < 100000; $i++) {
($nowuser, $nowsys) = times;
- $i = 200000 if $nowuser > $beguser && $nowsys > $begsys;
+ $i = 200000 if $nowuser > $beguser && ( $nowsys > $begsys ||
+ (!$nowsys && !$begsys));
last if time - $beg > 20;
}
last if time - $beg > 20;
}
@@
-29,6
+31,8
@@
if ($sec != $xsec && $mday && $year)
else
{print "not ok 3\n";}
else
{print "not ok 3\n";}
+exit 0 unless $does_gmtime;
+
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
($xsec,$foo) = localtime($now);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
($xsec,$foo) = localtime($now);
@@
-37,7
+41,13
@@
if ($sec != $xsec && $mday && $year)
else
{print "not ok 4\n";}
else
{print "not ok 4\n";}
-if (index(" :0:1:-1:36
5:366:-365:-366
:",':' . ($localyday - $yday) . ':') > 0)
+if (index(" :0:1:-1:36
4:365:-364:-365
:",':' . ($localyday - $yday) . ':') > 0)
{print "ok 5\n";}
else
{print "not ok 5\n";}
{print "ok 5\n";}
else
{print "not ok 5\n";}
+
+# This could be stricter.
+if (gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ \d]\d) (\d\d):(\d\d):(\d\d) (\d\d\d\d)$/)
+ {print "ok 6\n";}
+else
+ {print "not ok 6\n";}