timelocal.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./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],
);
# use vmsish 'time' makes for oddness around the Unix epoch
print "1..", @time * 2 + 5, "\n";
$count = 1;
for (@time) {
$year -= 1900;
$mon --;
# print scalar(localtime($time)), "\n";
if ($s == $sec &&
$m == $min &&
$h == $hour &&
$D == $mday &&
$M == $mon &&
$Y == $year
) {
} else {
}
$count++;
# Test gmtime function
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 sence...\n";
# Diff beween Jan 1, 1970 and Mar 1, 1970 = (31 + 28 = 59 days)
#print "Testing timelocal.pl module too...\n";
package test;