Bugzilla – Attachment 98763 Details for
Bug 24643
Koha::DateUtils::dt_from_string rfc3339 cannot handle high precision seconds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add unit tests
Add-unit-tests.patch (text/plain), 1.45 KB, created by
Andrew Isherwood
on 2020-02-12 16:29:34 UTC
(
hide
)
Description:
Add unit tests
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2020-02-12 16:29:34 UTC
Size:
1.45 KB
patch
obsolete
>From 201c83492b3a300ef5858b5e3cc618d5c9b0bfa8 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Wed, 12 Feb 2020 16:28:58 +0000 >Subject: [PATCH] Add unit tests > >https://bugs.koha-community.org/show_bug.cgi?id=24643 >--- > t/DateUtils.t | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 02ed2342b6..df49fcd506 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -4,7 +4,7 @@ use DateTime::TimeZone; > > use C4::Context; > >-use Test::More tests => 68; >+use Test::More tests => 71; > > use Test::MockModule; > use Test::Warn; >@@ -125,6 +125,15 @@ isa_ok( $dt0, 'DateTime', > 'dt_from_string returns a DateTime object passed a zero rfc3339 day' ); > cmp_ok( $dt0->ymd(), 'eq', $ymd, 'Returned object corrects rfc3339 day 0' ); > >+$dt0 = dt_from_string( '2012-01-01T23:59:00.0Z', 'rfc3339' ); >+cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 1 decimal place' ); >+ >+$dt0 = dt_from_string( '2012-01-01T23:59:00.00Z', 'rfc3339' ); >+cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 2 decimal places' ); >+ >+$dt0 = dt_from_string( '2012-01-01T23:59:00.000Z', 'rfc3339' ); >+cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 3 decimal places' ); >+ > # Return undef if passed mysql 0 dates > $dt0 = dt_from_string( '0000-00-00', 'iso' ); > is( $dt0, undef, "undefined returned for 0 iso date" ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24643
:
98762
|
98763
|
98764
|
98780
|
98781
|
98825
|
98826
|
98827