9 compare( $got_dt, $expected_dt, $test_description );
11 Will execute a test and compare the 2 dates given in parameters
12 The date will be compared truncated to minutes
17 my ( $got, $expected, $description ) = @_;
18 my $dt_got = dt_from_string
($got);
19 my $dt_expected = dt_from_string
($expected);
20 $dt_got->set_time_zone('floating');
21 $dt_expected->set_time_zone('floating');
22 my $diff = $dt_got->epoch - $dt_expected->epoch;
23 if ( abs($diff) < 6 ) { return 0 }
24 return $diff > 0 ?
1 : -1;