Support DateTime::Format::Natural >= 0.13_01 #352
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. This patch works okay if DateTime::Format::Natural v0.13 is used.
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.