mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-20 02:37:12 +03:00
;check: add tests for all on-demand checks
This commit is contained in:
parent
2084b845e0
commit
a6ec7bcc11
14
hledger/test/check-accounts.test
Normal file
14
hledger/test/check-accounts.test
Normal file
@ -0,0 +1,14 @@
|
||||
# check accounts succeeds when all accounts are declared
|
||||
<
|
||||
account a
|
||||
2020-01-01
|
||||
(a) 1
|
||||
$ hledger -f- check accounts
|
||||
|
||||
# and otherwise fails:
|
||||
<
|
||||
2020-01-01
|
||||
(a) 1
|
||||
$ hledger -f- check accounts
|
||||
>2 /undeclared account "a"/
|
||||
>=1
|
14
hledger/test/check-commodities.test
Normal file
14
hledger/test/check-commodities.test
Normal file
@ -0,0 +1,14 @@
|
||||
# check commodities succeeds when all commodities are declared
|
||||
<
|
||||
commodity $1.
|
||||
2020-01-01
|
||||
(a) $1
|
||||
$ hledger -f- check commodities
|
||||
|
||||
# and otherwise fails
|
||||
<
|
||||
2020-01-01
|
||||
(a) $1
|
||||
$ hledger -f- check commodities
|
||||
>2 /undeclared commodity "\$"/
|
||||
>=1
|
17
hledger/test/check-ordereddates.test
Normal file
17
hledger/test/check-ordereddates.test
Normal file
@ -0,0 +1,17 @@
|
||||
# check ordereddates succeeds when transaction dates are ordered
|
||||
<
|
||||
2020-01-01
|
||||
2020-01-01
|
||||
2020-01-02
|
||||
$ hledger -f- check ordereddates
|
||||
|
||||
# and otherwise fails
|
||||
<
|
||||
2020-01-01
|
||||
2020-01-02
|
||||
2020-01-01
|
||||
(a) 1
|
||||
$ hledger -f- check ordereddates
|
||||
> /transaction date is out of order/
|
||||
>=1
|
||||
# XXX make it >2
|
@ -1,5 +1,3 @@
|
||||
# check payees
|
||||
|
||||
# check payees succeeds when all payees are declared:
|
||||
<
|
||||
payee foo
|
||||
@ -7,7 +5,7 @@ payee foo
|
||||
2020-01-02 foo | some description
|
||||
$ hledger -f - check payees
|
||||
|
||||
# and otherwise fails, eg:
|
||||
# and otherwise fails:
|
||||
<
|
||||
2020-01-01 foo
|
||||
$ hledger -f - check payees
|
||||
|
16
hledger/test/check-uniqueleafnames.test
Normal file
16
hledger/test/check-uniqueleafnames.test
Normal file
@ -0,0 +1,16 @@
|
||||
# check uniqueleafnames succeeds when all account leaf names are unique
|
||||
<
|
||||
2020-01-01
|
||||
(a) 1
|
||||
(a:aa) 1
|
||||
$ hledger -f- check uniqueleafnames
|
||||
|
||||
# and otherwise fails
|
||||
<
|
||||
2020-01-01
|
||||
(a) 1
|
||||
(b:a) 1
|
||||
$ hledger -f- check uniqueleafnames
|
||||
> /a as a, b:a/
|
||||
>=1
|
||||
# XXX make it >2; improve message
|
Loading…
Reference in New Issue
Block a user