hledger/hledger/test/check-ordereddates.test

65 lines
1.2 KiB
Plaintext

# * check ordereddates
# ** 1. check ordereddates succeeds when transaction dates are ordered
<
2020-01-01
2020-01-01
2020-01-02
$ hledger -f- check ordereddates
# ** 2. and otherwise fails
<
2020-01-01
2020-01-02
2020-01-01
(a) 1
$ hledger -f- check ordereddates
>2 /date .*is out of order/
>=1
# ** 3. --date2 and secondary dates are ignored
<
2020-01-02
2020-01-01=2020-01-03
$ hledger -f- check ordereddates --date2
>2 /date .*is out of order/
>=1
# ** 4. ordereddates is checked before balance assertions, when both are enabled
<
2024-01-02
(a) 1 = 9
2024-01-01
(a) 1
$ hledger -f - check assertions ordereddates
>2 /date .*is out of order/
>=1
# ** 5. enabling the ordereddates check does not disable the balance assertions check
<
2024-01-01
(a) 1
2024-01-02
(a) 1 = 9
$ hledger -f - check assertions ordereddates
>2 /Balance assertion failed/
>=1
# XXX not supported: With a query, only matched transactions' dates are checked.
# <
# 2020-01-01 a
# 2020-01-03 b
# 2020-01-02 a
# $ hledger -f- check ordereddates
# XXX not supported: With --unique, dates must also be unique.
# <
# 2020-01-01
# 2020-01-01
# $ hledger -f- check ordereddates --unique
# >2 /transaction date is out of order and/or not unique/
# >=1