[OpenSRF-GIT] OpenSRF branch master updated. 316f58375c40087bfae32234c4dd3817260831e5
Evergreen Git
git at git.evergreen-ils.org
Mon Jul 31 12:54:03 EDT 2017
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 "OpenSRF".
The branch, master has been updated
via 316f58375c40087bfae32234c4dd3817260831e5 (commit)
from a481100ef9d5bd9eaad5a87ce29776cb07a8687c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 316f58375c40087bfae32234c4dd3817260831e5
Author: Mike Rylander <mrylander at gmail.com>
Date: Mon Jul 31 12:53:59 2017 -0400
LP#1635737: Unit tests for DST and date math
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/src/perl/t/09-Utils-interval_to_seconds.t b/src/perl/t/09-Utils-interval_to_seconds.t
index 4328fe2..2f82ea2 100644
--- a/src/perl/t/09-Utils-interval_to_seconds.t
+++ b/src/perl/t/09-Utils-interval_to_seconds.t
@@ -1,6 +1,8 @@
-#!perl -T
+#!perl
-use Test::More tests => 9;
+
+use DateTime::Format::ISO8601;
+use Test::More tests => 10;
BEGIN {
use_ok( 'OpenSRF::Utils' );
@@ -12,5 +14,14 @@ is (OpenSRF::Utils::interval_to_seconds('1 hour'), 3600);
is (OpenSRF::Utils::interval_to_seconds('1 day'), 86400);
is (OpenSRF::Utils::interval_to_seconds('1 week'), 604800);
is (OpenSRF::Utils::interval_to_seconds('1 month'), 2628000);
+
+# With context, no DST change
+is (OpenSRF::Utils::interval_to_seconds('1 month',
+ DateTime::Format::ISO8601->new->parse_datetime('2017-02-04T23:59:59-04')), 2419200);
+
+# With context, with DST change
+is (OpenSRF::Utils::interval_to_seconds('1 month',
+ DateTime::Format::ISO8601->new->parse_datetime('2017-02-14T23:59:59-04')), 2415600);
+
is (OpenSRF::Utils::interval_to_seconds('1 year'), 31536000);
is (OpenSRF::Utils::interval_to_seconds('1 year 1 second'), 31536001);
-----------------------------------------------------------------------
Summary of changes:
src/perl/t/09-Utils-interval_to_seconds.t | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
hooks/post-receive
--
OpenSRF
More information about the opensrf-commits
mailing list