From 65616d2ea5f7469103e660cd3a17cb2c1c065b1e Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 21 Jun 2017 21:54:00 +0100 Subject: fix slow tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit precision2.t only worked in 2010… --- t/precision2.t | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 't/precision2.t') diff --git a/t/precision2.t b/t/precision2.t index ef38f2a..abff8b8 100644 --- a/t/precision2.t +++ b/t/precision2.t @@ -11,12 +11,15 @@ else { } my $dt=DateTime->new(day=>1,month=>1,year=>2010, - hour=>0,minute=>0,second=>0, - time_zone=>'UTC'); + hour=>0,minute=>0,second=>0, + time_zone=>'UTC'); + +my $formatter= DateTime::Format::GeekTime->new(2010); + for my $i (0..86399) { - my $gkt=DateTime::Format::GeekTime->format_datetime($dt); - my $round_trip=DateTime::Format::GeekTime->parse_datetime($gkt); + my $gkt=$formatter->format_datetime($dt); + my $round_trip=$formatter->parse_datetime($gkt); my $diff=$round_trip->subtract_datetime_absolute($dt)->in_units('seconds'); - cmp_ok($diff,'<=',1); + cmp_ok($diff,'<=',1,"$round_trip - $dt"); $dt->add(seconds=>1); } -- cgit v1.2.3