hledger/tests/print/explicit.test
Stephen Morgan 9de238757b lib,cli,ui: Introduce showMixed*Unnormalised, eliminate most direct calls of strWidth.
This introduces some new helper functions which are exactly the same
as what we had before, but do not call
normaliseMixedAmountSquashPricesForDisplay, so that we can use the new
functions for displaying Transaction and Posting. It also goes through
and gets rid of most uses of the old showMixed* functions which would
benefit from using the new interface.
2020-11-04 14:25:20 +11:00

115 lines
1.6 KiB
Plaintext

# Tests of --explicit option effect
# 1. implicit transaction balance w/o --explict
hledger -f - print
<<<
2017/1/1
expenses $5
assets
>>>
2017-01-01
expenses $5
assets
>>>2
>>>=0
# 2. implicit transaction balance w/ --explict
hledger -f - print --explicit
<<<
2017/1/1
expenses $5
assets
>>>
2017-01-01
expenses $5
assets $-5
>>>2
>>>=0
# 3. implicit commodity price w/o --explict
hledger -f - print
<<<
2017/1/1
expenses 4 EUR
assets $-5
>>>
2017-01-01
expenses 4 EUR
assets $-5
>>>2
>>>=0
# 4. implicit commodity price w/ --explict
hledger -f - print --explicit
<<<
2017/1/1
expenses 4 EUR
assets $-5
>>>
2017-01-01
expenses 4 EUR @@ $5
assets $-5
>>>2
>>>=0
# 5. implicit account balance w/o --explict
hledger -f - print
<<<
2017/1/1
assets = $100
equity
>>>
2017-01-01
assets = $100
equity
>>>2
>>>=0
# 6. implicit account balance w/ --explict
hledger -f - print --explicit
<<<
2017/1/1
assets = $100
equity
>>>
2017-01-01
assets $100 = $100
equity $-100
>>>2
>>>=0
# 7. default commodity always applied because print do not issue appropriate directive
hledger -f - print
<<<
D 1000.00 EUR
2017/1/1
expenses 100
assets
>>>
2017-01-01
expenses 100.00 EUR
assets
>>>2
>>>=0
# 8. option --explicit implies effect of --empty
hledger -f - print --explicit
<<<
2017/1/1
assets $0
equity
>>>
2017-01-01
assets 0
equity 0
>>>2
>>>=0