2011-04-20 01:40:59 +04:00
|
|
|
# invalid dates should be rejected
|
|
|
|
# 1. valid month and day, but flipped
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f- print
|
2010-04-06 06:31:47 +04:00
|
|
|
<<<
|
|
|
|
2010/31/12 x
|
|
|
|
a 1
|
|
|
|
b
|
2018-05-23 05:17:51 +03:00
|
|
|
>>>2 /invalid date/
|
2010-04-06 06:31:47 +04:00
|
|
|
>>>= 1
|
2011-04-20 01:40:59 +04:00
|
|
|
# 2. too-large day
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f- print
|
2010-04-06 06:31:47 +04:00
|
|
|
<<<
|
|
|
|
2010/12/32 x
|
|
|
|
a 1
|
|
|
|
b
|
2018-05-23 05:17:51 +03:00
|
|
|
>>>2 /invalid date/
|
2010-04-06 06:31:47 +04:00
|
|
|
>>>= 1
|
2011-04-20 01:40:59 +04:00
|
|
|
# 3. 29th feb on leap year should be ok
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f- print
|
2011-04-20 00:15:14 +04:00
|
|
|
<<<
|
2011-04-20 01:40:59 +04:00
|
|
|
2000/2/29 x
|
2011-04-20 00:15:14 +04:00
|
|
|
a 1
|
|
|
|
b
|
|
|
|
>>>
|
2019-12-30 08:19:50 +03:00
|
|
|
2000-02-29 x
|
2017-06-05 07:26:18 +03:00
|
|
|
a 1
|
2017-01-13 18:25:44 +03:00
|
|
|
b
|
2011-04-20 01:40:59 +04:00
|
|
|
|
2011-04-20 00:15:14 +04:00
|
|
|
>>>= 0
|
2011-04-22 17:55:42 +04:00
|
|
|
# 4. 29th feb on non-leap year should fail
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f- print
|
2011-04-20 00:15:14 +04:00
|
|
|
<<<
|
2011-04-20 01:40:59 +04:00
|
|
|
2001/2/29 x
|
2011-04-20 00:15:14 +04:00
|
|
|
a 1
|
|
|
|
b
|
2018-05-23 05:17:51 +03:00
|
|
|
>>>2 /invalid date/
|
2011-04-20 00:15:14 +04:00
|
|
|
>>>= 1
|
2016-04-28 23:23:20 +03:00
|
|
|
# 5. dates must be followed by whitespace or newline
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f- print
|
2014-09-06 20:20:22 +04:00
|
|
|
<<<
|
2016-04-28 23:23:20 +03:00
|
|
|
2015/9/6*
|
2014-09-06 20:20:22 +04:00
|
|
|
a 0
|
2016-07-29 18:57:10 +03:00
|
|
|
>>>2 /unexpected '*'/
|
2014-09-06 20:20:22 +04:00
|
|
|
>>>= 1
|