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;
