:unittest.jdate

Test cases for the :jdate function

Description: call:unittest.jdate
Dependencies: :jdate, :Format
Script:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
:unittest.jdate
:$created 20080223 :$changed 20090328
:$source https://www.dostips.com
for %%C in (
        "Sat 02/23/2008"
        "02/23/2008"
        "12/31/2007"
        "01/01/2008"
        "01/06/2008"
        "01/07/2008"
        "01/08/2008"
        "01/09/2008"
        "1/1/100"
        "12/31/99"
        "1/1/0"
    ) do (
    call:jdate s "%%~C"
    call:Format "[35] [35]." "'%%~C'" "'%%s%%'"
)
EXIT /b
Script Output:
 DOS Script Output
---- :unittest.jdate - output
'Sat 02/23/2008'                    '2454520'                          .
'02/23/2008'                        '2454520'                          .
'12/31/2007'                        '2454466'                          .
'01/01/2008'                        '2454467'                          .
'01/06/2008'                        '2454472'                          .
'01/07/2008'                        '2454473'                          .
'01/08/2008'                        '2454474'                          .
'01/09/2008'                        '2454475'                          .
'1/1/100'                           '1757585'                          .
'12/31/99'                          '2488069'                          .
'1/1/0'                             '2451545'                          .
----