| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use warningsscip-perl cpan Date-Manip 6.99 warnings/; |
| 4 | use strictscip-perl cpan Date-Manip 6.99 strict/; |
| 5 | use Test::Interscip-perl cpan Date-Manip 6.99 Test/Inter/; |
| 6 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`. = new Test::Inter $0scip-perl cpan Date-Manip 6.99 main/$0.; |
| 7 | requirescip-perl cpan Date-Manip 6.99 main/require(). "tests.pl"; |
| 8 | |
| 9 | our $objscip-perl cpan Date-Manip 6.99 main/$obj. = new Date::Manip::Date; |
| 10 | $objscip-perl cpan Date-Manip 6.99 main/$obj.->configscip-perl cpan Date-Manip 6.99 main/config().("forcedate","2000-01-01-00:00:00,America/New_York"); |
| 11 | $objscip-perl cpan Date-Manip 6.99 main/$obj.->configscip-perl cpan Date-Manip 6.99 main/config().("ConfigFile","Holidays.3.cnf"); |
| 12 | |
| 13 | sub testscip-perl cpan Date-Manip 6.99 main/test(). { |
| 14 | my(@test)=@_scip-perl cpan Date-Manip 6.99 main/`@_`.; |
| 15 | my @date = $objscip-perl cpan Date-Manip 6.99 main/$obj.->list_holidaysscip-perl cpan Date-Manip 6.99 main/list_holidays().(@test); |
| 16 | my @ret = (); |
| 17 | foreach my $date (@date) { |
| 18 | my $d = $date->valuescip-perl cpan Date-Manip 6.99 main/value().(); |
| 19 | my @h = $date->holidayscip-perl cpan Date-Manip 6.99 main/holiday().(); |
| 20 | foreach my $h (@h) { |
| 21 | pushscip-perl cpan Date-Manip 6.99 main/push().(@ret,"$d = $h"); |
| 22 | } |
| 23 | } |
| 24 | return @ret; |
| 25 | } |
| 26 | |
| 27 | my $tests=" |
| 28 | |
| 29 | 2010 |
| 30 | => |
| 31 | '2010010100:00:00 = New Years Day (observed)' |
| 32 | '2010010100:00:00 = New Years Day' |
| 33 | '2010061700:00:00 = Bunker Hill Day' |
| 34 | '2010062000:00:00 = Father's Day' |
| 35 | '2010110200:00:00 = Election Day' |
| 36 | '2010110200:00:00 = Day of the Dead' |
| 37 | '2010123100:00:00 = New Years Day (observed)' |
| 38 | |
| 39 | 2012 |
| 40 | => |
| 41 | '2012010100:00:00 = New Years Day' |
| 42 | '2012010200:00:00 = New Years Day (observed)' |
| 43 | '2012061700:00:00 = Father's Day' |
| 44 | '2012061700:00:00 = Bunker Hill Day' |
| 45 | '2012110200:00:00 = Day of the Dead' |
| 46 | '2012110600:00:00 = Election Day' |
| 47 | |
| 48 | "; |
| 49 | |
| 50 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`.->testsscip-perl cpan Date-Manip 6.99 main/tests().(func => \&testscip-perl cpan Date-Manip 6.99 main/test()., |
| 51 | tests => $tests); |
| 52 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`.->done_testingscip-perl cpan Date-Manip 6.99 main/done_testing().(); |
| 53 | |
| 54 | #Local Variables: |
| 55 | #mode: cperl |
| 56 | #indent-tabs-mode: nil |
| 57 | #cperl-indent-level: 3 |
| 58 | #cperl-continued-statement-offset: 2 |
| 59 | #cperl-continued-brace-offset: 0 |
| 60 | #cperl-brace-offset: 0 |
| 61 | #cperl-brace-imaginary-offset: 0 |
| 62 | #cperl-label-offset: 0 |
| 63 | #End: |