From f0e737f43a8eec253e81ad06a8be24730fcf61fd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 23 Oct 2017 11:38:58 -0300 Subject: [PATCH] Bug 19176: Reduce the number of seconds to 5 Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- t/Test/Dates.t | 2 +- t/lib/Dates.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/t/Test/Dates.t b/t/Test/Dates.t index 5241f9e9ab..78206e2fc0 100644 --- a/t/Test/Dates.t +++ b/t/Test/Dates.t @@ -14,7 +14,7 @@ is( t::lib::Dates::compare( $dt_2, $dt_1 ), 1, '2018 is after 2017' ); is( t::lib::Dates::compare( $date_1, $date_2 ), -1, '2017 is before 2018 (strings comparison)' ); is( t::lib::Dates::compare( $date_2, $date_1 ), 1, '2018 is after 2017 (strings comparison)' ); -my $dt_3 = $dt_1->clone->subtract( seconds => 59 ); +my $dt_3 = $dt_1->clone->subtract( seconds => 5 ); is( t::lib::Dates::compare( $dt_1, $dt_3 ), 0, 'If there is less than 1min, the dates are considered identicals' ); is( t::lib::Dates::compare( $dt_3, $dt_1 ), diff --git a/t/lib/Dates.pm b/t/lib/Dates.pm index 1ba4d223bf..4e0f25faf4 100644 --- a/t/lib/Dates.pm +++ b/t/lib/Dates.pm @@ -20,7 +20,7 @@ sub compare { $dt_got->set_time_zone('floating'); $dt_expected->set_time_zone('floating'); my $diff = $dt_got->epoch - $dt_expected->epoch; - if ( abs($diff) < 60 ) { return 0 } + if ( abs($diff) < 6 ) { return 0 } return $diff > 0 ? 1 : -1; } -- 2.39.5