summaryrefslogtreecommitdiff
path: root/lib/Time/Local.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Time/Local.t')
-rwxr-xr-xlib/Time/Local.t47
1 files changed, 16 insertions, 31 deletions
diff --git a/lib/Time/Local.t b/lib/Time/Local.t
index ef32b40405..17e811583f 100755
--- a/lib/Time/Local.t
+++ b/lib/Time/Local.t
@@ -62,17 +62,6 @@ my @years =
[ 2100 => 0 ],
);
-# Use 3 days before the start of the epoch because with Borland on
-# Win32 it will work for -3600 _if_ your time zone is +01:00 (or
-# greater).
-my $neg_epoch_ok = defined ((localtime(-259200))[0]) ? 1 : 0;
-
-# use vmsish 'time' makes for oddness around the Unix epoch
-if ($^O eq 'VMS') {
- $time[0][2]++;
- $neg_epoch_ok = 0; # time_t is unsigned
-}
-
my $tests = (@time * 12);
$tests += @neg_time * 12;
$tests += @bad_time;
@@ -88,28 +77,23 @@ for (@time, @neg_time) {
$year -= 1900;
$mon--;
- SKIP: {
- skip '1970 test on VOS fails.', 12
- if $^O eq 'vos' && $year == 70;
- skip 'this platform does not support negative epochs.', 12
- if $year < 70 && ! $neg_epoch_ok;
-
- {
- my $year_in = $year < 70 ? $year + 1900 : $year;
- my $time = timelocal($sec,$min,$hour,$mday,$mon,$year_in);
-
- my($s,$m,$h,$D,$M,$Y) = localtime($time);
-
- is($s, $sec, "timelocal second for @$_");
- is($m, $min, "timelocal minute for @$_");
- is($h, $hour, "timelocal hour for @$_");
- is($D, $mday, "timelocal day for @$_");
- is($M, $mon, "timelocal month for @$_");
- is($Y, $year, "timelocal year for @$_");
- }
+ # Test timelocal()
+ {
+ my $year_in = $year < 70 ? $year + 1900 : $year;
+ my $time = timelocal($sec,$min,$hour,$mday,$mon,$year_in);
+
+ my($s,$m,$h,$D,$M,$Y) = localtime($time);
+
+ is($s, $sec, "timelocal second for @$_");
+ is($m, $min, "timelocal minute for @$_");
+ is($h, $hour, "timelocal hour for @$_");
+ is($D, $mday, "timelocal day for @$_");
+ is($M, $mon, "timelocal month for @$_");
+ is($Y, $year, "timelocal year for @$_");
}
- # Perl has its own gmtime()
+
+ # Test timegm()
{
my $year_in = $year < 70 ? $year + 1900 : $year;
my $time = timegm($sec,$min,$hour,$mday,$mon,$year_in);
@@ -125,6 +109,7 @@ for (@time, @neg_time) {
}
}
+
for (@bad_time) {
my($year, $mon, $mday, $hour, $min, $sec) = @$_;
$year -= 1900;