| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use warnings; |
| 4 | use strict; |
| 5 | use Test::Inter; |
| 6 | $::ti = new Test::Inter $0; |
| 7 | require "tests.pl"; |
| 8 | |
| 9 | our $dmt = new Date::Manip::TZ; |
| 10 | our $obj = $dmt->base(); |
| 11 | $dmt->config("forcedate","now,America/New_York"); |
| 12 | |
| 13 | sub test { |
| 14 | my(@test)=@_; |
| 15 | my @ret = $obj->day_of_year(@test); |
| 16 | return @ret; |
| 17 | } |
| 18 | |
| 19 | my $tests=" |
| 20 | |
| 21 | [ 1999 1 1 ] => 1 |
| 22 | |
| 23 | [ 1999 1 21 ] => 21 |
| 24 | |
| 25 | [ 1999 3 1 ] => 60 |
| 26 | |
| 27 | [ 2000 3 1 ] => 61 |
| 28 | |
| 29 | [ 1980 2 29 ] => 60 |
| 30 | |
| 31 | [ 1980 3 1 ] => 61 |
| 32 | |
| 33 | |
| 34 | 1999 1 => [ 1999 1 1 ] |
| 35 | |
| 36 | 1999 21 => [ 1999 1 21 ] |
| 37 | |
| 38 | 1999 60 => [ 1999 3 1 ] |
| 39 | |
| 40 | 2000 61 => [ 2000 3 1 ] |
| 41 | |
| 42 | 1980 60 => [ 1980 2 29 ] |
| 43 | |
| 44 | 1980 61 => [ 1980 3 1 ] |
| 45 | |
| 46 | "; |
| 47 | |
| 48 | $::ti->tests(func => \&test, |
| 49 | tests => $tests); |
| 50 | $::ti->done_testing(); |
| 51 | |
| 52 | #Local Variables: |
| 53 | #mode: cperl |
| 54 | #indent-tabs-mode: nil |
| 55 | #cperl-indent-level: 3 |
| 56 | #cperl-continued-statement-offset: 2 |
| 57 | #cperl-continued-brace-offset: 0 |
| 58 | #cperl-brace-offset: 0 |
| 59 | #cperl-brace-imaginary-offset: 0 |
| 60 | #cperl-label-offset: 0 |
| 61 | #End: |