From ff82c9aadc441f9ca18dcad2e58783e733cdd839 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 3 Nov 2017 13:50:27 -0300 Subject: [PATCH] Bug 19176: (QA follow-up) few cosmetic changes Signed-off-by: Jonathan Druart --- t/lib/Dates.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/t/lib/Dates.pm b/t/lib/Dates.pm index 330d5c58a1..66299d9eb1 100644 --- a/t/lib/Dates.pm +++ b/t/lib/Dates.pm @@ -1,7 +1,6 @@ package t::lib::Dates; use Modern::Perl; -use Test::More; use Koha::DateUtils; use DateTime; @@ -13,19 +12,19 @@ t::lib::Dates.pm - test helper module for working with dates =head2 compare - compare( $got_dt, $expected_dt, $test_description ); + compare( $got_dt, $expected_dt ); Will execute a test and compare the 2 dates given in parameters -The date will be compared truncated to minutes +The dates will be considered as identical if there are less than 5sec between them. =cut sub compare { - my ( $got, $expected, $description ) = @_; + my ( $got, $expected ) = @_; my $dt_got = dt_from_string($got); my $dt_expected = dt_from_string($expected); my $diff = $dt_got->epoch - $dt_expected->epoch; - if ( abs($diff) < 6 ) { return 0 } + if ( abs($diff) <= 5 ) { return 0 } return $diff > 0 ? 1 : -1; } -- 2.39.5