Bugzilla – Attachment 128076 Details for
Bug 29403
dt_from_string should fail if passed more data than expected for the format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29403: Unit tests
Bug-29403-Unit-tests.patch (text/plain), 1.38 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-29 14:16:51 UTC
(
hide
)
Description:
Bug 29403: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-29 14:16:51 UTC
Size:
1.38 KB
patch
obsolete
>From b2afb5954a56c323d6cdf406af2c266250990b0e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 3 Nov 2021 12:14:50 +0000 >Subject: [PATCH] Bug 29403: Unit tests > >Add a unit test for proper iso date handling > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/DateUtils.t | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 274c3f3975..7b85fb0294 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -4,7 +4,7 @@ use DateTime::TimeZone; > > use C4::Context; > >-use Test::More tests => 79; >+use Test::More tests => 80; > > use Test::MockModule; > use Test::Warn; >@@ -140,7 +140,12 @@ cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with > eval { > $dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' ); > }; >-like( $@, qr/.*does not match the date format \(rfc3339\).*/, 'dt_from_string should die when passed a bad date string' ); >+like( $@, qr/.*does not match the date format \(rfc3339\).*/, 'dt_from_string should die when passed a bad rfc3339 date string' ); >+ >+eval { >+ $dt0 = dt_from_string('2021-11-03T10:16:59+00:00', 'iso'); >+}; >+like( $@, qr/.*does not match the date format \(iso\).*/, 'dt_from_string should die when passed a bad iso date string' ); > > # Return undef if passed mysql 0 dates > $dt0 = dt_from_string( '0000-00-00', 'iso' ); >-- >2.32.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 29403
:
127246
|
127247
|
127254
|
128076
|
128077
|
128078
|
128272
|
128273
|
128274
|
128450
|
128451
|
128452
|
128825
|
128826
|
128827
|
128828
|
128829
|
129373
|
129374
|
129375
|
129376
|
129391
|
129392
|
129393
|
129394
|
129473
|
129486
|
129487
|
129488
|
129552
|
129553
|
129554
|
129555
|
129556