1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
use Test::More;
use Time::Piece;
use Time::Seconds;
# Large tests - test dates outside of the epoch range,
# somewhat silly, but lets see what happens
plan skip_all => "Large time tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );
TODO: {
local $TODO = "Big dates will probably fail on some platforms";
my $t = gmtime;
my $base_year = $t->year;
my $one_year = ONE_YEAR;
for ( 1 .. 50 ) {
$t = $t + $one_year;
cmp_ok(
$t->year, '==',
$base_year + $_,
"Year is: " . ( $base_year + $_ )
);
}
$t = gmtime;
$base_year = $t->year;
for ( 1 .. 200 ) {
$t = $t - $one_year;
cmp_ok(
$t->year, '==',
$base_year - $_,
"Year is: " . ( $base_year - $_ )
);
}
}
done_testing(250);
|