File: season_boundaries.t

package info (click to toggle)
libdatetime-calendar-discordian-perl 1.0-2.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 188 kB
  • sloc: perl: 803; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 30;
use DateTime;
use DateTime::Calendar::Discordian;

my $dt;
my $dtcd;
my @testdates = (
    [3,  13], [3,  14], [3,  15],
    [5,  25], [5,  26], [5,  27],
    [8,   6], [8,   7], [8,   8],
    [10, 18], [10, 19], [10, 20],
    [12, 30], [12, 31], [1,   1],
);

foreach my $year (2004, 2006)
{
    foreach my $date (@testdates)
    {
        $dt = DateTime->new( year   => $year,
                             month  => $date->[0],
                             day    => $date->[1],
                           );
        eval { 
            $dtcd = DateTime::Calendar::Discordian->from_object(object => $dt); 
        };
        ok($@ eq "", 'Discordian Calendar Object created') 
        or diag(($dt->utc_rd_values)[0] . ' '
           . join('/', $year, $date->[0], $date->[1]) . ": $@");
    }
}