File: 40leap-years.t

package info (click to toggle)
libdatetime-perl 2%3A1.59-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,916 kB
  • sloc: perl: 2,984; sh: 23; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;

use Test::More;

use DateTime;

undef $ENV{PERL_DATETIME_DEFAULT_TZ};

## no critic (Subroutines::ProtectPrivateSubs)
for my $y ( 0, 400, 2000, 2004 ) {
    ok( DateTime->_is_leap_year($y), "$y is a leap year" );
}

for my $y ( 1, 100, 1900, 2133 ) {
    ok( !DateTime->_is_leap_year($y), "$y is not a leap year" );
}

done_testing();