Debian Codegraph @

t/date.is_business_day.t

raw
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");
12
13 sub test {
14 my(@test)=@_;
15 my($date) = shift(@test);
16 $obj->set("date",$date);
17 return $obj->is_business_day(@test);
18 }
19
20 our $tests="
21
22 [ 2009 08 01 12 00 00 ] => 0
23
24 [ 2009 08 03 03 00 00 ] => 1
25
26 [ 2009 08 03 12 00 00 ] => 1
27
28 [ 2009 08 03 03 00 00 ] 1 => 0
29
30 [ 2009 08 03 12 00 00 ] 1 => 1
31
32 [ 2009 07 04 00 00 00 ] => 0
33
34 [ 2009 07 03 00 00 00 ] => 0
35
36 [ 2009 11 26 00 00 00 ] => 0
37
38 [ 2009 11 27 00 00 00 ] => 0
39
40 [ 1999 06 02 00 00 00 ] => 0
41
42 [ 1999 12 31 00 00 00 ] => 0
43
44 [ 2000 01 01 00 00 00 ] => 0
45
46 [ 1999 01 01 00 00 00 ] => 0
47
48 ";
49
50 $::ti->tests(func => \&test,
51 tests => $tests);
52 $::ti->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: