hledger/tests/register/depth.test
Simon Michael 21d9945ba9 tests: make functional tests use "hledger" again
Using "hledgerdev" was a hack to help ensure that tests used a fresh
developer build by default. Now they specify "hledger" again, which fits
better with stack. It's up to the tester to make sure the desired
executable is first in PATH or specified with -w. (Note a couple of
tests currently don't obey -w and will always run "hledger", see addons.test).
2015-07-12 12:29:53 -07:00

82 lines
1.7 KiB
Plaintext

# 1. register --depth N matches postings as usual but clips account names to N
hledger -f - register aa --depth 1
<<<
2010/1/1 x
a:aa:aaa 1
b
>>>
2010/01/01 x a 1 1
>>>=0
# 2. separate postings remain separate
hledger -f - register aa --depth 2
<<<
2010/1/1 x
a:aa 1
b:bb:bbb
2010/1/1 y
a:aa 1
b:bb:bbb
2010/1/2 z
a:aa 1
b:bb:bbb
>>>
2010/01/01 x a:aa 1 1
2010/01/01 y a:aa 1 2
2010/01/02 z a:aa 1 3
>>>=0
# 3. with a reporting interval, all postings are aggregated under each (clipped) account
hledger -f - register aa --depth 1 --daily
<<<
2010/1/1 x
a:aa 1
b:bb:bbb
2010/1/1 y
a:aa 1
b:bb:bbb
2010/1/2 z
a:aa 1
b:bb:bbb
>>>
2010/01/01d a 2 2
2010/01/02d a 1 3
>>>=0
# 4. with --cleared
hledger -f - register a --depth 1 --cleared
<<<
2012/1/1 *
(a:aa) 1
>>>
2012/01/01 (a) 1 1
>>>2
>>>=0
# 5. depth 0 aggregates everything into a single line
hledger -f - register --depth 0 --daily a b
<<<
2010/1/1 x
a:aa 1
b:bb 2
c:cc
2010/1/1 y
a:aa 1
b:bb 2
c:cc
2010/1/2 z
a:aa 1
b:bb 2
c:cc
>>>
2010/01/01d ... 6 6
2010/01/02d ... 3 9
>>>=0