Browse Source

Bug 24850: Correct tests for offset handling in RFC3339 dates

The tests were incorrectly passing for RFC3339 dates passed with an
offset.  This patch corrects the test.

Test plan:
1/ Read the change
2/ Agree the change adheres to the RFC
3/ Run the test and varify it now fails
3/ Signoff

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Martin Renvoize 4 years ago
committed by Jonathan Druart
parent
commit
d8d33c0e1b
  1. 4
      t/DateUtils.t

4
t/DateUtils.t

@ -134,8 +134,8 @@ cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with
$dt0 = dt_from_string( '2012-01-01t23:59:59.999z', 'rfc3339' );
cmp_ok( $dt0->epoch(), 'eq', '1325462399', 'dt_from_string handles seconds with 3 decimal places' );
$dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' );
cmp_ok( $dt0->epoch(), 'eq', '1325462399', 'dt_from_string handles seconds with 3 decimal places and a timezone' );
$dt0 = dt_from_string( '2012-01-01T23:59:59.999+02:00', 'rfc3339' );
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with 3 decimal places and a timezone' );
# Return undef if passed mysql 0 dates
$dt0 = dt_from_string( '0000-00-00', 'iso' );

Loading…
Cancel
Save