hledger/tests/journal/status.test
Simon Michael e119941648 rename "uncleared" status to "unmarked" and --uncleared to --unmarked (#564)
See the issue and linked mail list discussion. Ambiguity between the
uncleared state, and the "not cleared" --uncleared flag causes confusion
and friction. At this point it seems best to break with Ledger and
past hledger, pick a new name and drop --uncleared to put an end to it.
2017-06-15 19:16:39 -07:00

116 lines
2.2 KiB
Plaintext

## parsing
# 1. transactions and postings have status marks which are nothing, ! or *
hledger -fstatus.journal print
>>>
2017/01/01 unmarked
(a) 1
(b) 1
2017/01/02 ! pending
(a) 1
! (b) 1
2017/01/03 * cleared
(a) 1
* (b) 1
>>>=0
# 2. other characters will be considered part of the description
hledger -f- print desc:%
<<<
2017/01/01 %
>>>
2017/01/01 %
>>>=0
## matching with flags
# 3. --cleared matches * only
hledger -fstatus.journal print --cleared
>>>
2017/01/03 * cleared
(a) 1
* (b) 1
>>>=0
# 4. --pending matches ! only
hledger -fstatus.journal print --pending
>>>
2017/01/02 ! pending
(a) 1
! (b) 1
>>>=0
# 5. --unmarked matches no status mark only
hledger -fstatus.journal print --unmarked
>>>
2017/01/01 unmarked
(a) 1
(b) 1
>>>=0
# 6. these flags can be combined
hledger -fstatus.journal register --unmarked --pending
>>>
2017/01/01 unmarked (a) 1 1
(b) 1 2
2017/01/02 pending (a) 1 3
(b) 1 4
>>>= 0
# 7. these flags work with other commands
hledger -fstatus.journal balance -N --unmarked
>>>
1 a
1 b
>>>=0
## matching with status: query
# 8. status:* matches * only
hledger -fstatus.journal print status:*
>>>
2017/01/03 * cleared
(a) 1
* (b) 1
>>>=0
# 9. status:! matches ! only
hledger -fstatus.journal print status:!
>>>
2017/01/02 ! pending
(a) 1
! (b) 1
>>>=0
# 10. status: matches unmarked only
hledger -fstatus.journal print status:
>>>
2017/01/01 unmarked
(a) 1
(b) 1
>>>=0
# 11. multiple status: queries are OR'd
hledger -fstatus.journal print status: status:!
>>>
2017/01/01 unmarked
(a) 1
(b) 1
2017/01/02 ! pending
(a) 1
! (b) 1
>>>= 0