Debian Codegraph @

t/base.calc_time_time.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 $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->calc_time_time(@test);
16 return @ret;
17 }
18
19 my $tests="
20
21 [ +2 2 2 ] [ +1 1 1 ] => [ 3 3 3 ]
22
23 [ +2 2 2 ] [ -1 -1 -1 ] => [ 1 1 1 ]
24
25 [ +2 2 2 ] [ 1 1 1 ] 1 => [ 1 1 1 ]
26
27 [ 10 45 90 ] [ 5 30 45 ] => [ 16 17 15 ]
28
29 [ 10 45 90 ] [ -5 -30 -15 ] => [ 5 16 15 ]
30
31 [ 5 -5 +5 ] [ -2 +2 -2 ] => [ 2 57 3 ]
32
33 ";
34
35 $::ti->tests(func => \&test,
36 tests => $tests);
37 $::ti->done_testing();
38
39 #Local Variables:
40 #mode: cperl
41 #indent-tabs-mode: nil
42 #cperl-indent-level: 3
43 #cperl-continued-statement-offset: 2
44 #cperl-continued-brace-offset: 0
45 #cperl-brace-offset: 0
46 #cperl-brace-imaginary-offset: 0
47 #cperl-label-offset: 0
48 #End: