Blame t/date.next.t

Packit 95306a
#!/usr/bin/perl -w
Packit 95306a
Packit 95306a
use Test::Inter;
Packit 95306a
$t = new Test::Inter 'date :: next';
Packit 95306a
$testdir = '';
Packit 95306a
$testdir = $t->testdir();
Packit 95306a
Packit 95306a
use Date::Manip;
Packit 95306a
if (DateManipVersion() >= 6.00) {
Packit 95306a
   $t->feature("DM6",1);
Packit 95306a
}
Packit 95306a
Packit 95306a
$t->skip_all('Date::Manip 6.xx required','DM6');
Packit 95306a
Packit 95306a
Packit 95306a
sub test {
Packit 95306a
  (@test)=@_;
Packit 95306a
  my $date = shift(@test);
Packit 95306a
  $obj->set("date",$date);
Packit 95306a
  $err = $obj->next(@test);
Packit 95306a
  if ($err) {
Packit 95306a
     return $obj->err();
Packit 95306a
  } else {
Packit 95306a
     return [ $obj->value() ];
Packit 95306a
  }
Packit 95306a
}
Packit 95306a
Packit 95306a
$obj = new Date::Manip::Date;
Packit 95306a
$obj->config("forcedate","now,America/New_York");
Packit 95306a
Packit 95306a
$tests="
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 6         0                            => [ 1996 11 23 17 49 30 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 6         1                            => [ 1996 11 23 17 49 30 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         0                            => [ 1996 11 29 17 49 30 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         0                            => [ 1996 11 29 17 49 30 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         1                            => [ 1996 11 22 17 49 30 ]
Packit 95306a
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         0 [ 18 30 ]                  => [ 1996 11 29 18 30 0 ]
Packit 95306a
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         0 [ 18 30 45 ]               => [ 1996 11 29 18 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         1 [ 14 30 45 ]               => [ 1996 11 22 14 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] 5         2 [ 14 30 45 ]               => [ 1996 11 29 14 30 45 ]
Packit 95306a
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] __undef__ 0 [ 18 __undef__ __undef__ ] => [ 1996 11 22 18 0 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 33 ] __undef__ 0 [ 18 30 __undef__ ]        => [ 1996 11 22 18 30 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 33 ] __undef__ 0 [ 18 30 45 ]               => [ 1996 11 22 18 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 33 ] __undef__ 0 [ 18 __undef__ 45 ]        => [ 1996 11 22 18 0 45 ]
Packit 95306a
Packit 95306a
Packit 95306a
[ 1996 11 22 17 0 0 ]   __undef__ 0 [ 17 __undef__ __undef__ ] => [ 1996 11 23 17 0 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 0 0 ]   __undef__ 1 [ 17 0 0 ]                 => [ 1996 11 22 17 0 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 0 ]  __undef__ 0 [ 17 49 0 ]                => [ 1996 11 23 17 49 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 0 ]  __undef__ 1 [ 17 49 0 ]                => [ 1996 11 22 17 49 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 33 ] __undef__ 0 [ 17 49 33 ]               => [ 1996 11 23 17 49 33 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 33 ] __undef__ 1 [ 17 49 33 ]               => [ 1996 11 22 17 49 33 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 0 33 ]  __undef__ 0 [ 17 __undef__ 33 ]        => [ 1996 11 23 17 0 33 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 0 33 ]  __undef__ 1 [ 17 __undef__ 33 ]        => [ 1996 11 22 17 0 33 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] __undef__ 0 [ __undef__ 30 0 ]         => [ 1996 11 22 18 30 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] __undef__ 0 [ __undef__ 30 45 ]        => [ 1996 11 22 18 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 49 30 ] __undef__ 0 [ __undef__ __undef__ 30 ] => [ 1996 11 22 17 50 30 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 0 ]  __undef__ 0 [ __undef__ 30 0 ]         => [ 1996 11 22 18 30 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 0 ]  __undef__ 1 [ __undef__ 30 0 ]         => [ 1996 11 22 17 30 0 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 45 ] __undef__ 0 [ __undef__ 30 45 ]        => [ 1996 11 22 18 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 45 ] __undef__ 1 [ __undef__ 30 45 ]        => [ 1996 11 22 17 30 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 45 ] __undef__ 0 [ __undef__ __undef__ 45 ] => [ 1996 11 22 17 31 45 ]
Packit 95306a
Packit 95306a
[ 1996 11 22 17 30 45 ] __undef__ 1 [ __undef__ __undef__ 45 ] => [ 1996 11 22 17 30 45 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  4         0                            => [ 2002 11 28 18 15 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  4         0 [ 12 30 ]                  => [ 2002 11 28 12 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         0                            => [ 2002 11 29 18 15 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         1                            => [ 2002 11 22 18 15 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         2                            => [ 2002 11 29 18 15 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         0 [ 12 30 ]                  => [ 2002 11 29 12 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         1 [ 12 30 ]                  => [ 2002 11 22 12 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         2 [ 12 30 ]                  => [ 2002 11 29 12 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         0 [ 19 30 ]                  => [ 2002 11 29 19 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         1 [ 19 30 ]                  => [ 2002 11 22 19 30 0 ]
Packit 95306a
Packit 95306a
[ 2002 11 22 18 15 0 ]  5         2 [ 19 30 ]                  => [ 2002 11 22 19 30 0 ]
Packit 95306a
";
Packit 95306a
Packit 95306a
$t->tests(func  => \&test,
Packit 95306a
          tests => $tests);
Packit 95306a
$t->done_testing();
Packit 95306a
Packit 95306a
#Local Variables:
Packit 95306a
#mode: cperl
Packit 95306a
#indent-tabs-mode: nil
Packit 95306a
#cperl-indent-level: 3
Packit 95306a
#cperl-continued-statement-offset: 2
Packit 95306a
#cperl-continued-brace-offset: 0
Packit 95306a
#cperl-brace-offset: 0
Packit 95306a
#cperl-brace-imaginary-offset: 0
Packit 95306a
#cperl-label-offset: 0
Packit 95306a
#End: