hledger/tests/journal/status.test
2020-01-07 15:58:54 -08: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