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

86 lines
2.0 KiB
Plaintext

# 1. monthly reporting interval, no end dates, shows just the intervals with data:
hledger -f- register --period 'monthly'
<<<
2011/2/1
(a) 1
>>>
2011/02 a 1 1
>>>=0
# 2. or with a query pattern, just the intervals with matched data:
hledger -f- register --period 'monthly' b
<<<
2011/1/1
(a) 1
2011/2/1
(b) 1
>>>
2011/02 b 1 1
>>>=0
# 3. with --empty, show all intervals spanned by the journal
# (unlike current ledger, but more useful)
hledger -f- register --period 'monthly' b --empty
<<<
2011/1/1
(a) 1
2011/2/1
(b) 1
2011/3/1
(c) 1
>>>
2011/01 0 0
2011/02 b 1 1
2011/03 0 1
>>>=0
# 4. any specified begin/end dates limit the intervals reported
hledger -f- register --period 'monthly to 2011/3/1' b --empty
<<<
2011/1/1
(a) 1
2011/2/1
(b) 1
2011/3/1
(c) 1
>>>
2011/01 0 0
2011/02 b 1 1
>>>=0
# 5. --date2 should work with intervals
hledger -f- register --monthly --date2
<<<
2014/1/1
(a) 1
2014/2/1=2014/1/31
(b) 1
>>>
2014/01 a 1 1
b 1 2
>>>=0
# 6. All matched postings in the displayed intervals should be reported on.
hledger -f- register -p 'monthly 2014/1/10-2014/2/20'
<<<
2014/1/5
(before) 1
2014/2/1
(within) 1
2014/2/25
(after) 1
>>>
2014/01 before 1 1
2014/02 after 1 2
within 1 3
>>>=0