| 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 $obj = new Date::Manip::Date; |
| 10 |
$obj->config("forcedate","now,America/New_York"); |
| 11 |
$obj->config("ConfigFile","Manip.cnf.part1"); |
| 12 |
$obj->config("ConfigFile","Manip.cnf.part2"); |
| 13 |
|
| 14 |
sub test { |
| 15 |
my(@test)=@_; |
| 16 |
my($date) = shift(@test); |
| 17 |
$obj->set("date",$date); |
| 18 |
return $obj->holiday(); |
| 19 |
} |
| 20 |
|
| 21 |
my $tests=qq{ |
| 22 |
|
| 23 |
[ 2009 08 01 12 00 00 ] => __undef__ |
| 24 |
|
| 25 |
[ 2009 08 03 03 00 00 ] => __undef__ |
| 26 |
|
| 27 |
[ 2009 08 03 12 00 00 ] => __undef__ |
| 28 |
|
| 29 |
[ 2009 07 04 00 00 00 ] => __undef__ |
| 30 |
|
| 31 |
[ 2009 07 03 00 00 00 ] => 'Independence Day' |
| 32 |
|
| 33 |
[ 2009 11 26 00 00 00 ] => Thanksgiving |
| 34 |
|
| 35 |
[ 2009 11 27 00 00 00 ] => __blank__ |
| 36 |
|
| 37 |
[ 1999 12 31 00 00 00 ] => "New Year's Day" |
| 38 |
|
| 39 |
[ 2000 01 01 00 00 00 ] => __undef__ |
| 40 |
|
| 41 |
[ 2001 01 01 00 00 00 ] => "New Year's Day" |
| 42 |
|
| 43 |
}; |
| 44 |
|
| 45 |
$::ti->tests(func => \&test, |
| 46 |
tests => $tests); |
| 47 |
$::ti->done_testing(); |
| 48 |
|
| 49 |
#Local Variables: |
| 50 |
#mode: cperl |
| 51 |
#indent-tabs-mode: nil |
| 52 |
#cperl-indent-level: 3 |
| 53 |
#cperl-continued-statement-offset: 2 |
| 54 |
#cperl-continued-brace-offset: 0 |
| 55 |
#cperl-brace-offset: 0 |
| 56 |
#cperl-brace-imaginary-offset: 0 |
| 57 |
#cperl-label-offset: 0 |
| 58 |
#End: |