9 t::lib::Dates.pm - test helper module for working with dates
15 compare( $got_dt, $expected_dt );
17 Will execute a test and compare the 2 dates given in parameters
18 The dates will be considered as identical if there are less than 5sec between them.
23 my ( $got, $expected ) = @_;
24 my $dt_got = dt_from_string
($got);
25 my $dt_expected = dt_from_string
($expected);
26 my $diff = $dt_got->epoch - $dt_expected->epoch;
27 if ( abs($diff) <= 5 ) { return 0 }
28 return $diff > 0 ?
1 : -1;