From 8cfd6bb6035d3df21a187497500b8c27e22a46b3 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Tue, 16 Mar 2021 12:53:50 +0000
Subject: [PATCH] Bug 27937: Unit test

---
 t/DateUtils.t | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/t/DateUtils.t b/t/DateUtils.t
index 5b00c77124..2a5f010dbd 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 => 81;
 
 use Test::MockModule;
 use Test::Warn;
@@ -22,8 +22,13 @@ my $tz = C4::Context->tz;
 
 isa_ok( $tz, 'DateTime::TimeZone', 'Context returns timezone object' );
 
-my $testdate_iso = '2011-06-16';                   # Bloomsday 2011
+my $testdate_iso = '2011-6-16';
 my $dt = dt_from_string( $testdate_iso, 'iso' );
+isa_ok( $dt, 'DateTime', 'dt_from_string returns a DateTime object' );
+cmp_ok( $dt->ymd(), 'eq', '2011-06-16', 'Returned object is standardized to 2 digit day' );
+
+$testdate_iso = '2011-06-16';                   # Bloomsday 2011
+$dt = dt_from_string( $testdate_iso, 'iso' );
 
 isa_ok( $dt, 'DateTime', 'dt_from_string returns a DateTime object' );
 
-- 
2.11.0