[Bps-public-commit] Date-Extract branch test-mocktime-hires created. 0.06-1-gd6bc447

BPS Git Server git at git.bestpractical.com
Mon Jan 9 18:31:10 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Date-Extract".

The branch, test-mocktime-hires has been created
        at  d6bc447bf96b7ab52bd2883e540d12edf2cbfa96 (commit)

- Log -----------------------------------------------------------------
commit d6bc447bf96b7ab52bd2883e540d12edf2cbfa96
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Jan 9 13:20:53 2023 -0500

    Switch to Test::MockTime::HiRes in tests
    
    Version 1.14 of DateTime::Format::Natural added support for
    milliseconds, which involved changing DateTime calls to
    DateTime::HiRes. DateTime::HiRes uses Time::HiRes::time(),
    and Test::MockTime doesn't overload that time function. This
    resulted in test times being returned as "now" rather than the
    mocked time.
    
    Switch to Test::MockTime::HiRes, which does overload the HiRes
    time functions. This module also overloads the same time functions
    as Test::MockTime, so this change should be compatible with
    earlier versions of DateTime::Format::Natural.

diff --git a/t/02-extract.t b/t/02-extract.t
index c3af19c..f2e62fe 100644
--- a/t/02-extract.t
+++ b/t/02-extract.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use Test::More tests => 50;
-use Test::MockTime 'set_fixed_time';
+use Test::MockTime::HiRes 'set_fixed_time';
 use Date::Extract;
 
 # a Friday. The time I wrote this line of code, in fact (in UTC)
diff --git a/t/03-returns.t b/t/03-returns.t
index d3be60d..90932b5 100644
--- a/t/03-returns.t
+++ b/t/03-returns.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use Test::More tests => 17;
-use Test::MockTime 'set_fixed_time';
+use Test::MockTime::HiRes 'set_fixed_time';
 use Date::Extract;
 
 # a Thursday. The time I wrote this line of code, in fact (in UTC)
diff --git a/t/05-format.t b/t/05-format.t
index 0b43f8b..c83dbe4 100644
--- a/t/05-format.t
+++ b/t/05-format.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use Test::More tests => 3;
-use Test::MockTime 'set_fixed_time';
+use Test::MockTime::HiRes 'set_fixed_time';
 use Date::Extract;
 
 # a Thursday. The time I wrote this line of code, in fact (in UTC)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Date-Extract


More information about the Bps-public-commit mailing list