Fix up unit tests.

This commit is contained in:
Dianne Skoll
2020-02-26 17:43:47 -05:00
parent 0826678209
commit 2a08be8fd0
2 changed files with 22 additions and 0 deletions

View File

@@ -1819,6 +1819,20 @@ set x ampm(23:12) + ""
ampm(23:12) => "11:12PM" ampm(23:12) => "11:12PM"
"11:12PM" + "" => "11:12PM" "11:12PM" + "" => "11:12PM"
# Coerce with am/pm
set x coerce("TIME", "12:45am")
coerce("TIME", "12:45am") => 00:45
set x coerce("TIME", "12:45")
coerce("TIME", "12:45") => 12:45
set x coerce("TIME", "1:45pm")
coerce("TIME", "1:45pm") => 13:45
set x coerce("DATETIME", "2020-05-05@12:45am")
coerce("DATETIME", "2020-05-05@12:45am") => 2020-05-05@00:45
set x coerce("DATETIME", "2020-05-05@12:45")
coerce("DATETIME", "2020-05-05@12:45") => 2020-05-05@12:45
set x coerce("DATETIME", "2020-05-05@1:45pm")
coerce("DATETIME", "2020-05-05@1:45pm") => 2020-05-05@13:45
Test 2 Test 2

View File

@@ -517,6 +517,14 @@ set x ampm(21:12) + ""
set x ampm(22:12) + "" set x ampm(22:12) + ""
set x ampm(23:12) + "" set x ampm(23:12) + ""
# Coerce with am/pm
set x coerce("TIME", "12:45am")
set x coerce("TIME", "12:45")
set x coerce("TIME", "1:45pm")
set x coerce("DATETIME", "2020-05-05@12:45am")
set x coerce("DATETIME", "2020-05-05@12:45")
set x coerce("DATETIME", "2020-05-05@1:45pm")
__EOF__ __EOF__
REM This line should not even be seen REM This line should not even be seen
And you can put whatever you like here. And you can put whatever you like here.