#!/usr/bin/perl use warnings; use strict; use Test::Inter; $::ti = new Test::Inter $0; require "tests.pl"; our $dmt = new Date::Manip::TZ; our $obj = $dmt->base(); $dmt->config("forcedate","now,America/New_York"); sub test { my (@test)=@_; my @ret = $obj->calc_date_time(@test); return @ret; } my $tests=" [ 2000 01 15 12 00 00 ] [ 1 0 0 ] => [ 2000 1 15 13 0 0 ] [ 2000 01 15 12 00 00 ] [ -1 0 0 ] => [ 2000 1 15 11 0 0 ] [ 2000 01 15 12 00 00 ] [ 1 1 0 ] => [ 2000 1 15 13 1 0 ] [ 2000 01 15 12 00 00 ] [ -1 -1 0 ] => [ 2000 1 15 10 59 0 ] [ 2000 01 15 12 00 00 ] [ 1 1 1 ] => [ 2000 1 15 13 1 1 ] [ 2000 01 15 12 00 00 ] [ -1 -1 -1 ] => [ 2000 1 15 10 58 59 ] [ 2000 01 15 12 00 00 ] [ 0 1 0 ] => [ 2000 1 15 12 1 0 ] [ 2000 01 15 12 00 00 ] [ 0 -1 0 ] => [ 2000 1 15 11 59 0 ] [ 2000 01 15 12 00 00 ] [ 0 1 1 ] => [ 2000 1 15 12 1 1 ] [ 2000 01 15 12 00 00 ] [ 0 -1 -1 ] => [ 2000 1 15 11 58 59 ] [ 2000 01 15 12 00 00 ] [ 0 0 1 ] => [ 2000 1 15 12 0 1 ] [ 2000 01 15 12 00 00 ] [ 0 0 -1 ] => [ 2000 1 15 11 59 59 ] [ 2000 01 15 12 00 00 ] [ +24 0 0 ] => [ 2000 1 16 12 0 0 ] [ 2000 01 15 12 00 00 ] [ -24 0 0 ] => [ 2000 1 14 12 0 0 ] [ 1999 12 31 12 00 00 ] [ +24 0 0 ] => [ 2000 1 1 12 0 0 ] [ 2000 01 01 12 00 00 ] [ -24 0 0 ] => [ 1999 12 31 12 0 0 ] [ 2000 12 31 12 00 00 ] [ +24 0 0 ] => [ 2001 1 1 12 0 0 ] [ 2000 01 15 12 00 00 ] [ +49 1 0 ] => [ 2000 1 17 13 1 0 ] "; $::ti->tests(func => \&test, tests => $tests); $::ti->done_testing(); #Local Variables: #mode: cperl #indent-tabs-mode: nil #cperl-indent-level: 3 #cperl-continued-statement-offset: 2 #cperl-continued-brace-offset: 0 #cperl-brace-offset: 0 #cperl-brace-imaginary-offset: 0 #cperl-label-offset: 0 #End: