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