hledger/tests/balancesheet/balancesheet.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

244 lines
18 KiB
Plaintext

# 1. trivial balance sheet
hledger -f - balancesheet
<<<
2016/1/1
assets 1
b
>>>
Balance Sheet 2016/01/01
|| 2016/01/01
=============++============
Assets ||
-------------++------------
assets || 1
-------------++------------
|| 1
=============++============
Liabilities ||
-------------++------------
-------------++------------
||
=============++============
Net: || 1
>>>2
>>>= 0
# 2. monthly balance sheet, normal positive sign
# old (arithmetic sign):
#Balance Sheet
#
# || 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
#======================++================================================================================================================================================
# Assets ||
#----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
# assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
# assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
# assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
#----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
# || $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
#======================++================================================================================================================================================
# Liabilities ||
#----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
# liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $1
#----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
# || 0 0 0 0 0 0 0 0 0 0 0 $1
#======================++================================================================================================================================================
# Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
#
hledger -f sample.journal balancesheet -p 'monthly in 2008'
>>>
Balance Sheet 2008
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
======================++================================================================================================================================================
Assets ||
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
======================++================================================================================================================================================
Liabilities ||
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $-1
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $-1
======================++================================================================================================================================================
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>=0
# 3. monthly balance sheet in tree mode
# old (arithmetic sign):
# || 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
#==============++================================================================================================================================================
# Assets ||
#--------------++------------------------------------------------------------------------------------------------------------------------------------------------
# assets || $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
# bank || $1 $1 $1 $1 $1 $2 $2 $2 $2 $2 $2 $1
# checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
# saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
# cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
#--------------++------------------------------------------------------------------------------------------------------------------------------------------------
# || $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
#==============++================================================================================================================================================
# Liabilities ||
#--------------++------------------------------------------------------------------------------------------------------------------------------------------------
# liabilities || 0 0 0 0 0 0 0 0 0 0 0 $1
# debts || 0 0 0 0 0 0 0 0 0 0 0 $1
#--------------++------------------------------------------------------------------------------------------------------------------------------------------------
# || 0 0 0 0 0 0 0 0 0 0 0 $1
#==============++================================================================================================================================================
# Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
#
hledger -f sample.journal balancesheet -p 'monthly in 2008' --tree
>>>
Balance Sheet 2008
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
==============++================================================================================================================================================
Assets ||
--------------++------------------------------------------------------------------------------------------------------------------------------------------------
assets || $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
bank || $1 $1 $1 $1 $1 $2 $2 $2 $2 $2 $2 $1
checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
--------------++------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
==============++================================================================================================================================================
Liabilities ||
--------------++------------------------------------------------------------------------------------------------------------------------------------------------
liabilities || 0 0 0 0 0 0 0 0 0 0 0 $-1
debts || 0 0 0 0 0 0 0 0 0 0 0 $-1
--------------++------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $-1
==============++================================================================================================================================================
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>= 0
# 4. monthly balancesheet with average/total columns and without overall totals row
hledger -f sample.journal balancesheet -p 'monthly in 2008' -NAT
>>>
Balance Sheet 2008
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Total Average
======================++==================================================================================================================================================================
Assets ||
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------------
assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0 $11 $1
assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1 $7 $1
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2 $-14 $-1
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1 $4 0
======================++==================================================================================================================================================================
Liabilities ||
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------------
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $-1 $-1 0
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $-1 $-1 0
>>>= 0
# 5. Tree output still works, #565
hledger -f- balancesheet
<<<
2017/1/1
(assets:b) 1
>>>
Balance Sheet 2017/01/01
|| 2017/01/01
=============++============
Assets ||
-------------++------------
assets || 1
b || 1
-------------++------------
|| 1
=============++============
Liabilities ||
-------------++------------
-------------++------------
||
=============++============
Net: || 1
>>>2
>>>=0
# 6. Flat output still works, #552
hledger -f- balancesheet --flat
<<<
2017/1/1
(assets:b) 1
>>>
Balance Sheet 2017/01/01
|| 2017/01/01
=============++============
Assets ||
-------------++------------
assets:b || 1
-------------++------------
|| 1
=============++============
Liabilities ||
-------------++------------
-------------++------------
||
=============++============
Net: || 1
>>>2
>>>=0
# 7. An empty section is does not disrupt the overall totals, #588
hledger -f- balancesheet -YTA
<<<
2017/1/1
(assets) $1
>>>
Balance Sheet 2017/01/01
|| 2017/12/31 Total Average
=============++==============================
Assets ||
-------------++------------------------------
assets || $1 $1 $1
-------------++------------------------------
|| $1 $1 $1
=============++==============================
Liabilities ||
-------------++------------------------------
-------------++------------------------------
||
=============++==============================
Net: || $1 $1 $1
>>>2
>>>=0
# 9. --pretty-tables uses unicode chars for borders
hledger -f - balancesheet -M --pretty-tables
<<<
2016/1/1
assets 1
b
>>>
Balance Sheet 2016/01/01
║ 2016/01/31
═════════════╬════════════
Assets ║
─────────────╫────────────
assets ║ 1
─────────────╫────────────
║ 1
═════════════╬════════════
Liabilities ║
─────────────╫────────────
─────────────╫────────────
═════════════╬════════════
Net: ║ 1
>>>2
>>>= 0