hledger/hledger/test/journal/status.test
Simon Michael e9cd1df048 dev: tests: convert remaining format 1 tests to format 3 (or 2)
Mostly done with an unreleased version of shelltestrunner, plus a few manual fixups.
2023-02-16 11:55:15 -10:00

103 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
<
2017/01/01 %
$ hledger -f- print desc:%
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
# 7. these flags work with other commands
$ hledger -fstatus.journal balance -N --unmarked
1 a
1 b
## 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