The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use v6-alpha;
use Test;
plan 16;

use Date;

for [ 2004,  1,  1,   1 ],
    [ 2004,  3, 31,  91 ],
    [ 2004,  4,  1,  92 ],
    [ 2004,  6, 30, 182 ],
    [ 2004,  7,  1, 183 ],
    [ 2004,  9, 30, 274 ],
    [ 2004, 10,  1, 275 ],
    [ 2004, 12, 31, 366 ],
    [ 2005,  1,  1,   1 ],
    [ 2005,  3, 31,  90 ],
    [ 2005,  4,  1,  91 ],
    [ 2005,  6, 30, 181 ],
    [ 2005,  7,  1, 182 ],
    [ 2005,  9, 30, 273 ],
    [ 2005, 10,  1, 274 ],
    [ 2005, 12, 31, 365 ] {
    my ( $y, $m, $d, $doy ) = @$_;

    my $date = Date.new( year => $y, month => $m, day => $d );
    is( $date.day_of_year, $doy, "day of year is $doy" );
}