#!./perl
BEGIN {
chdir('t') if -d 't';
}
}
# Set up time values to test
@time =
(
#year,mon,day,hour,min,sec
[1970, 1, 2, 00, 00, 00],
[1980, 2, 28, 12, 00, 00],
[1980, 2, 29, 12, 00, 00],
[1999, 12, 31, 23, 59, 59],
[2000, 1, 1, 00, 00, 00],
[2010, 10, 12, 14, 13, 12],
[2020, 2, 29, 12, 59, 59],
[2030, 7, 4, 17, 07, 06],
# The following test fails on a surprising number of systems
# so it is commented out. The end of the Epoch for a 32-bit signed
# implementation of time_t should be Jan 19, 2038 03:14:07 UTC.
# [2038, 1, 17, 23, 59, 59], # last full day in any tz
);
# use vmsish 'time' makes for oddness around the Unix epoch
my $tests = @time * 2 + 4;
$count = 1;
for (@time) {
$year -= 1900;
$mon --;
} else {
# print scalar(localtime($time)), "\n";
if ($s == $sec &&
$m == $min &&
$h == $hour &&
$D == $mday &&
$M == $mon &&
$Y == $year
) {
} else {
}
}
$count++;
# Test gmtime function
} else {
if ($s == $sec &&
$m == $min &&
$h == $hour &&
$D == $mday &&
$M == $mon &&
$Y == $year
) {
} else {
}
}
$count++;
}
#print "Testing that the differences between a few dates makes sense...\n";
# Diff beween Jan 1, 1980 and Mar 1, 1980 = (31 + 29 = 60 days)
# bugid #19393
# At a DST transition, the clock skips forward, eg from 01:59:59 to
# 03:00:00. In this case, 02:00:00 is an invalid time, and should be
# treated like 03:00:00 rather than 01:00:00 - negative zone offsets used
# to do the latter
{
# other testers should get 2
}
#print "Testing timelocal.pl module too...\n";
package test;
}