1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
From 28481171ee3345c8bed6efb9d5a46cfce1547fc0 Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <andrew@etc.gen.nz>
Date: Sat, 4 Feb 2023 02:45:55 +1300
Subject: Support DateTime::Format::Natural >= 0.13_01
Version 0.13_01 switched from using DateTime to DateTime::HiRes for setting
the initial time. This means we in turn need to use Test::MockTime::HiRes.
Error I was getting in Debian with libdatetime-format-natural-perl v0.14 and
v0.15:
t/api/date.t .. 4/?
# Failed test 'April in the past'
# at t/api/date.t line 650.
# got: '2023-03-31 16:00:00'
# expected: '2015-03-31 16:00:00'
# Failed test 'Monday in the past'
# at t/api/date.t line 655.
# got: '2023-01-29 16:00:00'
# expected: '2015-11-22 16:00:00'
# Failed test 'April in the future'
# at t/api/date.t line 661.
# got: '2023-03-31 16:00:00'
# expected: '2016-03-31 16:00:00'
# Some tests failed or we bailed out, tmp directory '/home/puck/personal/RT/debian/rt/request-tracker5/t/tmp/api-date.t-qhyuAiqU' is not cleaned
# Looks like you failed 3 tests of 231.
Patch-Name: libdatetime-format-natural-perl-v0.14.diff
Forwarded: https://github.com/bestpractical/rt/pull/352
---
etc/cpanfile | 1 +
t/api/date.t | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/etc/cpanfile b/etc/cpanfile
index 1b156421..68f9c557 100644
--- a/etc/cpanfile
+++ b/etc/cpanfile
@@ -136,6 +136,7 @@ on 'develop' => sub {
requires 'Test::Expect', '>= 0.31';
requires 'Test::LongString';
requires 'Test::MockTime';
+ requires 'Test::MockTime::HiRes';
requires 'Test::NoWarnings';
requires 'Test::Pod';
requires 'Test::Warn';
diff --git a/t/api/date.t b/t/api/date.t
index aee517d9..7f7ecd70 100644
--- a/t/api/date.t
+++ b/t/api/date.t
@@ -1,5 +1,5 @@
-use Test::MockTime qw(set_fixed_time restore_time);
+use Test::MockTime::HiRes qw(set_fixed_time restore_time);
use DateTime;
use warnings;
|