Debian Codegraph @

t/delta.type.t

raw symbols SCIP
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 my $obj = new Date::Manip::Delta;
10 $obj->config("forcedate","now,America/New_York");
11
12 sub test {
13 my(@args) = @_;
14 if (@args == 1) {
15 my($type) = @args;
16 return $obj->type($type);
17 } else {
18 my($op,$val) = @args;
19 $obj->set($op,$val);
20 return 0
21 }
22 }
23
24 my $tests="
25
26 standard [ 0 0 0 0 1 2 3 ] => 0
27
28 business => 0
29
30 standard => 1
31
32 exact => 1
33
34 semi => 0
35
36 approx => 0
37
38 ###
39
40 standard [ 0 0 1 2 1 2 3 ] => 0
41
42 business => 0
43
44 standard => 1
45
46 exact => 0
47
48 semi => 1
49
50 approx => 0
51
52 ###
53
54 delta [ 1 0 0 0 1 2 3 ] => 0
55
56 business => 0
57
58 standard => 1
59
60 exact => 0
61
62 semi => 0
63
64 approx => 1
65
66 ###
67
68 business [ 0 0 0 0 1 2 3 ] => 0
69
70 business => 1
71
72 standard => 0
73
74 exact => 1
75
76 semi => 0
77
78 approx => 0
79
80 ###
81
82 business [ 0 0 0 1 1 2 3 ] => 0
83
84 business => 1
85
86 standard => 0
87
88 exact => 1
89
90 semi => 0
91
92 approx => 0
93
94 ###
95
96 business [ 0 0 1 2 1 2 3 ] => 0
97
98 business => 1
99
100 standard => 0
101
102 exact => 0
103
104 semi => 1
105
106 approx => 0
107
108 ###
109
110 delta [ 1 0 0 0 10 20 30 ] => 0
111
112 business => 0
113
114 standard => 1
115
116 exact => 0
117
118 semi => 0
119
120 approx => 1
121
122 ###
123
124 ";
125
126 $::ti->tests(func => \&test,
127 tests => $tests);
128 $::ti->done_testing();
129
130 #Local Variables:
131 #mode: cperl
132 #indent-tabs-mode: nil
133 #cperl-indent-level: 3
134 #cperl-continued-statement-offset: 2
135 #cperl-continued-brace-offset: 0
136 #cperl-brace-offset: 0
137 #cperl-brace-imaginary-offset: 0
138 #cperl-label-offset: 0
139 #End: