hledger/tests/parse-dates.test

38 lines
515 B
Plaintext
Raw Normal View History

2011-04-20 01:40:59 +04:00
# invalid dates should be rejected
# 1. valid month and day, but flipped
2010-05-22 04:52:45 +04:00
bin/hledger -f- print
<<<
2010/31/12 x
a 1
b
>>>2 /bad date/
>>>= 1
2011-04-20 01:40:59 +04:00
# 2. too-large day
2010-05-22 04:52:45 +04:00
bin/hledger -f- print
<<<
2010/12/32 x
a 1
b
>>>2 /bad date/
>>>= 1
2011-04-20 01:40:59 +04:00
# 3. 29th feb on leap year should be ok
bin/hledger -f- print
<<<
2011-04-20 01:40:59 +04:00
2000/2/29 x
a 1
b
>>>
2011-04-20 01:40:59 +04:00
2000/02/29 x
a 1
b -1
2011-04-20 01:40:59 +04:00
>>>= 0
# 4. 29th feb on non-leap year should fail
bin/hledger -f- print
<<<
2011-04-20 01:40:59 +04:00
2001/2/29 x
a 1
b
>>>2 /bad date/
>>>= 1