hledger/tests/journal/comments.test
Simon Michael 5c09553481 lib: keep amounts aligned when rendering a transaction with posting flags
Related to #563, when rendering a transaction, we reserve two more chars
of width so that amounts remain aligned when there are posting flags.
Affects hledger-ui's transaction screen, print, hledger-rewrite etc.
2017-06-04 21:26:18 -07:00

87 lines
1.6 KiB
Plaintext

# comment tests
# 1.
hledger -f - print
<<<
2009/01/01 x
; transaction comment 1
; transaction comment 2
a 1
b
>>>
2009/01/01 x
; transaction comment 1
; transaction comment 2
a 1
b
>>>=0
# 2.
hledger -f - print
<<<
2009/01/01 x
a 1
b
; comment line after postings
>>>
2009/01/01 x
a 1
b
>>>=0
# 3. print should preserve transaction (entry) comments and which line they're on
hledger -f - print
<<<
; leading journal comment, not preserved
; transaction preceding comment, not preserved
2009/1/1 x ; transaction same line comment
; transaction new line comment
a 1 ; posting 1 same line comment
; posting 1 new line comment
b
; posting 2 new line comment
; journal comment right after the transaction, not preserved
; trailing journal comment, not preserved
>>>
2009/01/01 x ; transaction same line comment
; transaction new line comment
a 1 ; posting 1 same line comment
; posting 1 new line comment
b
; posting 2 new line comment
>>>2
>>>=0
# 4. a posting comment should appear in print
hledger -f - print
<<<
2010/01/01 x
a 1 ; comment
b -1
>>>
2010/01/01 x
a 1 ; comment
b -1
>>>2
>>>=0
# 5. a posting comment should not appear in register
hledger -f - register
<<<
2010/1/1 x
a 1 ; comment
b
>>>
2010/01/01 x a 1 1
b -1 0
>>>2
>>>=0