hledger/tests/budget/budget.test
Simon Michael e491f513a1 cli: tabular reports no longer have a trailing blank line added
Tabular reports from bal, bs etc. have until now been rendered on
the terminal with one final blank line, for readability.
This change drops the blank line.

This is consistent with the non-tabular balance and register output
(not print, which is a special case), and with most unix commands.
The real reason for it, which I admit is flimsy, is that I can now omit
the final delimiter (>=0) when using shelltestrunner 1.9's new format,
making functional tests easier to maintain and more readable.
If there's opposition, this could be reverted.
2018-01-23 12:47:56 -08:00

140 lines
3.8 KiB
Plaintext

# Test --budget switch
hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget
<<<
2016/12/01
expenses:food $10
assets:cash
2016/12/02
expenses:food $9
assets:cash
2016/12/03
expenses:food $11
assets:cash
2016/12/02
expenses:leisure $5
assets:cash
2016/12/03
expenses:movies $25
assets:cash
2016/12/03
expenses:cab $15
assets:cash
~ daily from 2016/1/1
expenses:food $10
expenses:leisure $15
assets:cash
>>>
Balance changes in 2016/12/01-2016/12/03:
|| 2016/12/01 2016/12/02 2016/12/03
=======================++=============================================================
<unbudgeted>:expenses || 0 0 $40
assets:cash || $-10 [40% of $-25] $-14 [56% of $-25] $-51 [204% of $-25]
expenses:food || $10 [100% of $10] $9 [90% of $10] $11 [110% of $10]
expenses:leisure || 0 [0% of $15] $5 [33% of $15] 0 [0% of $15]
-----------------------++-------------------------------------------------------------
|| 0 0 0
>>>2
>>>=0
# --show-unbudgeted
hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget --show-unbudgeted
<<<
2016/12/01
expenses:food $10
assets:cash
2016/12/02
expenses:food $9
assets:cash
2016/12/03
expenses:food $11
assets:cash
2016/12/02
expenses:leisure $5
assets:cash
2016/12/03
expenses:movies $25
assets:cash
2016/12/03
expenses:cab $15
assets:cash
~ daily from 2016/1/1
expenses:food $10
expenses:leisure $15
assets:cash
>>>
Balance changes in 2016/12/01-2016/12/03:
|| 2016/12/01 2016/12/02 2016/12/03
==================++=============================================================
assets:cash || $-10 [40% of $-25] $-14 [56% of $-25] $-51 [204% of $-25]
expenses:cab || 0 0 $15
expenses:food || $10 [100% of $10] $9 [90% of $10] $11 [110% of $10]
expenses:leisure || 0 [0% of $15] $5 [33% of $15] 0 [0% of $15]
expenses:movies || 0 0 $25
------------------++-------------------------------------------------------------
|| 0 0 0
>>>2
>>>=0
# Test that budget works with mix of commodities
hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget
<<<
2016/12/01
expenses:food £10 @@ $15
assets:cash
2016/12/02
expenses:food 10 CAD @ $1
assets:cash
2016/12/02
expenses:food 10 CAD @ $1.1
assets:cash
2016/12/03
expenses:food $11
assets:cash
2016/12/02
expenses:leisure $5
assets:cash
2016/12/03
expenses:movies $25
assets:cash
2016/12/03
expenses:cab $15
assets:cash
~ daily from 2016/1/1
expenses:food $10
expenses:leisure $15
assets:cash
>>>
Balance changes in 2016/12/01-2016/12/03:
|| 2016/12/01 2016/12/02 2016/12/03
=======================++================================================================
<unbudgeted>:expenses || 0 0 $40
assets:cash || $-15 [60% of $-25] $-26.0 [104% of $-25] $-51 [204% of $-25]
expenses:food || £10 [150% of $10] 20 CAD [210% of $10] $11 [110% of $10]
expenses:leisure || 0 [0% of $15] $5 [33% of $15] 0 [0% of $15]
-----------------------++----------------------------------------------------------------
|| $-15, £10 $-21.0, 20 CAD 0
>>>2
>>>=0