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).
This commit is contained in:
Simon Michael 2015-07-12 11:54:08 -07:00
parent 1e7b7529af
commit 21d9945ba9
51 changed files with 207 additions and 205 deletions

View File

@ -2,14 +2,14 @@
# data validation # data validation
# #
# 1. should prompt again for a bad date # 1. should prompt again for a bad date
hledgerdev -f $$-add.j add; rm -f $$-add.j hledger -f $$-add.j add; rm -f $$-add.j
<<< <<<
2009/1/32 2009/1/32
>>> /A valid hledger smart date is required/ >>> /A valid hledger smart date is required/
>>>=0 >>>=0
# 2. should accept a blank date # 2. should accept a blank date
hledgerdev -f $$-add.j add; rm -f $$-add.j hledger -f $$-add.j add; rm -f $$-add.j
<<< <<<
>>> /Date .*Description:/ >>> /Date .*Description:/
@ -19,7 +19,7 @@ hledgerdev -f $$-add.j add; rm -f $$-add.j
# precision and commodity handling # precision and commodity handling
# #
# 3. simple add with no existing journal, no commodity entered # 3. simple add with no existing journal, no commodity entered
hledgerdev -f $$-add.j add; rm -f $$-add.j hledger -f $$-add.j add; rm -f $$-add.j
<<< <<<
@ -32,7 +32,7 @@ b
>>>=0 >>>=0
# 4. default commodity with greater precision # 4. default commodity with greater precision
printf 'D $1000.00\n' >t$$.j; hledgerdev -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j printf 'D $1000.00\n' >t$$.j; hledger -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j
<<< <<<
@ -46,7 +46,7 @@ b
>>>=0 >>>=0
# 5. default commodity with less precision # 5. default commodity with less precision
printf 'D $1000.0\n' >t$$.j; hledgerdev -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j printf 'D $1000.0\n' >t$$.j; hledger -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j
<<< <<<
@ -60,7 +60,7 @@ b
>>>=0 >>>=0
# 6. existing commodity with greater precision # 6. existing commodity with greater precision
printf '2010/1/1\n a $1000.00\n b\n' >t$$.j; hledgerdev -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j printf '2010/1/1\n a $1000.00\n b\n' >t$$.j; hledger -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j
<<< <<<
@ -73,7 +73,7 @@ b
>>>=0 >>>=0
# 7. existing commodity with less precision # 7. existing commodity with less precision
printf '2010/1/1\n a $1000.0\n b\n' >t$$.j; hledgerdev -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j printf '2010/1/1\n a $1000.0\n b\n' >t$$.j; hledger -f t$$.j add >/dev/null; cat t$$.j; rm -f t$$.j
<<< <<<
@ -87,7 +87,7 @@ b
>>>=0 >>>=0
# 8. default amounts should not fail to balance due to precision # 8. default amounts should not fail to balance due to precision
rm -f nosuch.journal; hledgerdev -f nosuch.journal add; rm -f nosuch.journal rm -f nosuch.journal; hledger -f nosuch.journal add; rm -f nosuch.journal
<<< <<<
2010/1/1 2010/1/1
x x
@ -100,8 +100,8 @@ c
>>>=0 >>>=0
## 9. shouldn't add decimals if there aren't any ## 9. shouldn't add decimals if there aren't any
## printf '\n\na\n1\nb\n' | hledgerdev -f /dev/null add ## printf '\n\na\n1\nb\n' | hledger -f /dev/null add
# hledgerdev -f /dev/null add # hledger -f /dev/null add
# <<< # <<<

View File

@ -1,17 +1,19 @@
# "make test" sets up the dummy add-on scripts required for these tests # "make test" sets up the dummy add-on scripts required for these tests
#XXX these don't obey shelltest -w, always running the hledger executable in PATH
# 14. flags after an add-command are handled by the add-on # 14. flags after an add-command are handled by the add-on
PATH=$PATH:. hledgerdev addon --help PATH=$PATH:. hledger addon --help
>>> /hledger-addon/ >>> /hledger-addon/
>>>=0 >>>=0
# 15. add-on flags which are not also defined in the main executable are a problem # 15. add-on flags which are not also defined in the main executable are a problem
PATH=$PATH:. hledgerdev addon --addonflag PATH=$PATH:. hledger addon --addonflag
>>>2 /Unknown flag: --addonflag/ >>>2 /Unknown flag: --addonflag/
>>>=1 >>>=1
# 16. hledger main executable ignores anything after -- (and hides the -- from the add-on) # 16. hledger main executable ignores anything after -- (and hides the -- from the add-on)
PATH=$PATH:. hledgerdev addon --help -- --addonflag PATH=$PATH:. hledger addon --help -- --addonflag
>>> /hledger-addon/ >>> /hledger-addon/
>>>=0 >>>=0

View File

@ -1,6 +1,6 @@
# issue 219, --tree and --flat flags should override each other cleanly # issue 219, --tree and --flat flags should override each other cleanly
# 1. multiple flags ending with --flat, equivalent to --flat # 1. multiple flags ending with --flat, equivalent to --flat
hledgerdev -f balance-multicol.journal bal -MEH --no-total date:2013/1 --tree --flat hledger -f balance-multicol.journal bal -MEH --no-total date:2013/1 --tree --flat
>>> >>>
Ending balances (historical) in 2013/01: Ending balances (historical) in 2013/01:
@ -11,7 +11,7 @@ Ending balances (historical) in 2013/01:
>>>= 0 >>>= 0
# 2. multiple flags ending with --tree, equivalent to --tree # 2. multiple flags ending with --tree, equivalent to --tree
hledgerdev -f balance-multicol.journal bal -MEH --no-total date:2013/1 --flat --tree hledger -f balance-multicol.journal bal -MEH --no-total date:2013/1 --flat --tree
>>> >>>
Ending balances (historical) in 2013/01: Ending balances (historical) in 2013/01:

View File

@ -1,5 +1,5 @@
# 1. issue 87, hledger should give this balance. # 1. issue 87, hledger should give this balance.
hledgerdev -f - balance --no-total b hledger -f - balance --no-total b
<<< <<<
1/1 1/1
a -553.653 X @@ 2609.92 a -553.653 X @@ 2609.92
@ -26,7 +26,7 @@ hledgerdev -f - balance --no-total b
>>>= 0 >>>= 0
# 2. As above, but the prices have a commodity - should work the same. # 2. As above, but the prices have a commodity - should work the same.
hledgerdev -f - balance --no-total b hledger -f - balance --no-total b
<<< <<<
1/1 1/1
a -553.653 X @@ 2609.92 Y a -553.653 X @@ 2609.92 Y

View File

@ -1,5 +1,5 @@
# 1. # 1.
hledgerdev -f sample.journal balance hledger -f sample.journal balance
>>> >>>
$-1 assets $-1 assets
$1 bank:saving $1 bank:saving
@ -16,7 +16,7 @@ hledgerdev -f sample.journal balance
>>>=0 >>>=0
# 2. # 2.
hledgerdev -f sample.journal balance o hledger -f sample.journal balance o
>>> >>>
$1 expenses:food $1 expenses:food
$-2 income $-2 income

View File

@ -1,4 +1,4 @@
hledgerdev -f - balance -p 'in 2009' --date2 hledger -f - balance -p 'in 2009' --date2
<<< <<<
2009/1/1 x 2009/1/1 x
a 1 a 1

View File

@ -1,5 +1,5 @@
# 1. # 1.
hledgerdev -f sample.journal balance --no-total --depth 1 hledger -f sample.journal balance --no-total --depth 1
>>> >>>
$-1 assets $-1 assets
$2 expenses $2 expenses
@ -8,13 +8,13 @@ hledgerdev -f sample.journal balance --no-total --depth 1
>>>=0 >>>=0
# 2. Depth 0 aggregates everything into one line # 2. Depth 0 aggregates everything into one line
hledgerdev -f sample.journal balance --no-total --depth 0 hledger -f sample.journal balance --no-total --depth 0
>>> >>>
0 ... 0 ...
>>>=0 >>>=0
# 3. Ditto in a multi-column balance report. # 3. Ditto in a multi-column balance report.
hledgerdev -f sample.journal balance -M -e 2008/4 --depth 0 hledger -f sample.journal balance -M -e 2008/4 --depth 0
>>> >>>
Balance changes in 2008/01: Balance changes in 2008/01:

View File

@ -1,6 +1,6 @@
# --flat shows inclusive balances; total balance should be that of top-level accounts (issue 94) # --flat shows inclusive balances; total balance should be that of top-level accounts (issue 94)
# # 1. # # 1.
# hledgerdev -f - balance --flat # hledger -f - balance --flat
# <<< # <<<
# 1/1 # 1/1
# (a) 1 # (a) 1
@ -14,7 +14,7 @@
# --flat shows exclusive balances # --flat shows exclusive balances
# 1. # 1.
hledgerdev -f - balance --flat hledger -f - balance --flat
<<< <<<
1/1 1/1
(a:aa) 1 (a:aa) 1
@ -34,7 +34,7 @@ hledgerdev -f - balance --flat
# --flat --depth shows the same accounts, but clipped and aggregated at the depth limit # --flat --depth shows the same accounts, but clipped and aggregated at the depth limit
# 2. # 2.
hledgerdev -f - balance --flat --depth 2 hledger -f - balance --flat --depth 2
<<< <<<
1/1 1/1
(a:aa) 1 (a:aa) 1

View File

@ -1,4 +1,4 @@
hledgerdev -f sample.journal balance --format="%30(account) %-.20(total)" hledger -f sample.journal balance --format="%30(account) %-.20(total)"
>>> >>>
assets $-1 assets $-1
bank:saving $1 bank:saving $1

View File

@ -1,7 +1,7 @@
# multi-column balance reports # multi-column balance reports
# 1. Here are the postings used in most tests below: # 1. Here are the postings used in most tests below:
hledgerdev -f balance-multicol.journal register hledger -f balance-multicol.journal register
>>> >>>
2012/12/31 (assets:checking) 10 10 2012/12/31 (assets:checking) 10 10
2013/01/01 (assets:checking) 1 11 2013/01/01 (assets:checking) 1 11
@ -12,7 +12,7 @@ hledgerdev -f balance-multicol.journal register
>>>=0 >>>=0
# 2. A period balance (flow) report. --no-total also works but isn't pretty. # 2. A period balance (flow) report. --no-total also works but isn't pretty.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --no-total hledger -f balance-multicol.journal balance -p 'monthly in 2013' --no-total
>>> >>>
Balance changes in 2013q1: Balance changes in 2013q1:
@ -25,8 +25,8 @@ Balance changes in 2013q1:
>>>=0 >>>=0
# 3. With --empty, includes leading/trailing empty periods # 3. With --empty, includes leading/trailing empty periods
#hledgerdev -f balance-multicol.journal balance -p 'quarterly in 2013' --empty #hledger -f balance-multicol.journal balance -p 'quarterly in 2013' --empty
hledgerdev -f - balance -p 'quarterly in 2013' --empty hledger -f - balance -p 'quarterly in 2013' --empty
<<< <<<
2012/12/31 2012/12/31
(a) 10 (a) 10
@ -47,7 +47,7 @@ Balance changes in 2013:
# 4. A cumulative ending balance report. Column totals are the sum of # 4. A cumulative ending balance report. Column totals are the sum of
# the highest-level displayed accounts (here, assets). # the highest-level displayed accounts (here, assets).
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative
>>> >>>
Ending balances (cumulative) in 2013q1: Ending balances (cumulative) in 2013q1:
@ -64,7 +64,7 @@ Ending balances (cumulative) in 2013q1:
# 5. With the assets:cash account excluded. As with a single-column # 5. With the assets:cash account excluded. As with a single-column
# balance --flat report, or ledger's balance --flat, assets' balance # balance --flat report, or ledger's balance --flat, assets' balance
# includes the displayed subaccount and not the excluded one. # includes the displayed subaccount and not the excluded one.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative not:cash hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative not:cash
>>> >>>
Ending balances (cumulative) in 2013q1: Ending balances (cumulative) in 2013q1:
@ -78,7 +78,7 @@ Ending balances (cumulative) in 2013q1:
>>>=0 >>>=0
# 6. A historical ending balance report. # 6. A historical ending balance report.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --historical hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical
>>> >>>
Ending balances (historical) in 2013q1: Ending balances (historical) in 2013q1:
@ -94,7 +94,7 @@ Ending balances (historical) in 2013q1:
# 7. With top-level accounts excluded. As always, column totals are the sum of # 7. With top-level accounts excluded. As always, column totals are the sum of
# the highest-level displayed accounts, now assets:cash and assets:checking. # the highest-level displayed accounts, now assets:cash and assets:checking.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' not:assets$ hledger -f balance-multicol.journal balance -p 'monthly in 2013' not:assets$
>>> >>>
Balance changes in 2013q1: Balance changes in 2013q1:
@ -108,7 +108,7 @@ Balance changes in 2013q1:
>>>=0 >>>=0
# 8. cumulative: # 8. cumulative:
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' not:assets$ --cumulative hledger -f balance-multicol.journal balance -p 'monthly in 2013' not:assets$ --cumulative
>>> >>>
Ending balances (cumulative) in 2013q1: Ending balances (cumulative) in 2013q1:
@ -122,7 +122,7 @@ Ending balances (cumulative) in 2013q1:
>>>=0 >>>=0
# 9. historical # 9. historical
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --historical hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical
>>> >>>
Ending balances (historical) in 2013q1: Ending balances (historical) in 2013q1:
@ -139,7 +139,7 @@ Ending balances (historical) in 2013q1:
# --depth # --depth
# 10. A flow report with depth limiting. The depth limit aggregates the three accounts as "assets". # 10. A flow report with depth limiting. The depth limit aggregates the three accounts as "assets".
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1
>>> >>>
Balance changes in 2013q1: Balance changes in 2013q1:
@ -152,7 +152,7 @@ Balance changes in 2013q1:
>>>=0 >>>=0
# 11. As above, but postings in the top-level assets account have been excluded. # 11. As above, but postings in the top-level assets account have been excluded.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 assets: hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 assets:
>>> >>>
Balance changes in 2013q1: Balance changes in 2013q1:
@ -165,7 +165,7 @@ Balance changes in 2013q1:
>>>=0 >>>=0
# 12. A cumulative balance report with depth limiting. # 12. A cumulative balance report with depth limiting.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --cumulative hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --cumulative
>>> >>>
Ending balances (cumulative) in 2013q1: Ending balances (cumulative) in 2013q1:
@ -178,7 +178,7 @@ Ending balances (cumulative) in 2013q1:
>>>=0 >>>=0
# 13. A historical balance report with depth limiting. # 13. A historical balance report with depth limiting.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --historical hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --historical
>>> >>>
Ending balances (historical) in 2013q1: Ending balances (historical) in 2013q1:
@ -191,7 +191,7 @@ Ending balances (historical) in 2013q1:
>>>=0 >>>=0
# 14. The three multicol balance report types again, this time with --tree # 14. The three multicol balance report types again, this time with --tree
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --tree hledger -f balance-multicol.journal balance -p 'monthly in 2013' --tree
>>> >>>
Balance changes in 2013q1: Balance changes in 2013q1:
@ -206,7 +206,7 @@ Balance changes in 2013q1:
>>>=0 >>>=0
# 15. # 15.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative --tree hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative --tree
>>> >>>
Ending balances (cumulative) in 2013q1: Ending balances (cumulative) in 2013q1:
@ -221,7 +221,7 @@ Ending balances (cumulative) in 2013q1:
>>>=0 >>>=0
# 16. # 16.
hledgerdev -f balance-multicol.journal balance -p 'monthly in 2013' --historical --tree hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical --tree
>>> >>>
Ending balances (historical) in 2013q1: Ending balances (historical) in 2013q1:
@ -236,7 +236,7 @@ Ending balances (historical) in 2013q1:
>>>=0 >>>=0
# 17. --date2 should work # 17. --date2 should work
hledgerdev -f- balance --monthly --date2 hledger -f- balance --monthly --date2
<<< <<<
2014/1/1 2014/1/1
(a) 1 (a) 1
@ -257,7 +257,7 @@ Balance changes in 2014/01:
>>>=0 >>>=0
# 18. All matched postings in the displayed intervals should be reported on. # 18. All matched postings in the displayed intervals should be reported on.
hledgerdev -f- balance -p 'monthly 2014/1/10-2014/2/20' hledger -f- balance -p 'monthly 2014/1/10-2014/2/20'
<<< <<<
2014/1/5 2014/1/5
(before) 1 (before) 1

View File

@ -1,6 +1,6 @@
#!/usr/bin/env shelltest #!/usr/bin/env shelltest
# 1. One commodity. Zero accounts should be elided but the final total should not. # 1. One commodity. Zero accounts should be elided but the final total should not.
hledgerdev -f - balance hledger -f - balance
<<< <<<
2010/04/01 tr1 2010/04/01 tr1
a 16$ a 16$
@ -15,7 +15,7 @@ hledgerdev -f - balance
>>>=0 >>>=0
# 2. An uninteresting parent account (with same balance as its single subaccount) is elided by default, like ledger # 2. An uninteresting parent account (with same balance as its single subaccount) is elided by default, like ledger
hledgerdev -f - balance --no-total hledger -f - balance --no-total
<<< <<<
1/1 1/1
(a:b) 1 (a:b) 1
@ -24,7 +24,7 @@ hledgerdev -f - balance --no-total
>>>=0 >>>=0
# 3. But not with --no-elide # 3. But not with --no-elide
hledgerdev -f - balance --no-total --no-elide hledger -f - balance --no-total --no-elide
<<< <<<
1/1 1/1
(a:b) 1 (a:b) 1
@ -34,7 +34,7 @@ hledgerdev -f - balance --no-total --no-elide
>>>=0 >>>=0
# 4. Nor when it has more than one subaccount # 4. Nor when it has more than one subaccount
hledgerdev -f - balance --no-total hledger -f - balance --no-total
<<< <<<
1/1 1/1
(a:b) 1 (a:b) 1
@ -47,7 +47,7 @@ hledgerdev -f - balance --no-total
>>>=0 >>>=0
# 5. Zero-balance leaves should also be hidden by default. # 5. Zero-balance leaves should also be hidden by default.
hledgerdev -f - balance --no-total hledger -f - balance --no-total
<<< <<<
1/1 1/1
(a) 1 (a) 1

View File

@ -1,5 +1,5 @@
# #
hledgerdev -f- balance hledger -f- balance
<<< <<<
1/1 1/1
a 1.00 a 1.00

View File

@ -60,55 +60,55 @@
# version # version
# 1. --version shows version # 1. --version shows version
hledgerdev --version hledger --version
>>> /^hledger [0-9]/ >>> /^hledger [0-9]/
>>>=0 >>>=0
# 2. --version also works after a command, if it's internal # 2. --version also works after a command, if it's internal
hledgerdev balance --version hledger balance --version
>>> /^hledger [0-9]/ >>> /^hledger [0-9]/
>>>=0 >>>=0
# help # help
# 3. with no command, show general help # 3. with no command, show general help
hledgerdev hledger
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 4. no-command help still works if there are flags, at least the common ones # 4. no-command help still works if there are flags, at least the common ones
hledgerdev -fsomefile hledger -fsomefile
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 5. and also with a space between flag and value # 5. and also with a space between flag and value
hledgerdev -f somefile hledger -f somefile
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 6. with --help, and possibly other common flags present, show general help # 6. with --help, and possibly other common flags present, show general help
hledgerdev --help --version -f /dev/null hledger --help --version -f /dev/null
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 7. with --help before COMMAND, show general help # 7. with --help before COMMAND, show general help
hledgerdev --help balance --cost hledger --help balance --cost
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 8. with --help after command, show command help # 8. with --help after command, show command help
hledgerdev balance --help hledger balance --help
>>> /^balance \[OPTIONS\]/ >>> /^balance \[OPTIONS\]/
>>>=0 >>>=0
# 9. should work with deprecated commands too # 9. should work with deprecated commands too
hledgerdev convert --help hledger convert --help
>>> >>>
>>>2 /no longer needed/ >>>2 /no longer needed/
>>>=1 >>>=1
# 10. with an unrecognised command, give general help and non-zero exit status # 10. with an unrecognised command, give general help and non-zero exit status
hledgerdev nosuchcommand hledger nosuchcommand
>>> >>>
>>>2 /not recognized/ >>>2 /not recognized/
>>>=1 >>>=1
@ -116,18 +116,18 @@ hledgerdev nosuchcommand
# flag positions # flag positions
# 11. most flags can not go before command # 11. most flags can not go before command
hledgerdev --daily register hledger --daily register
>>> >>>
>>>2 /Unknown flag: --daily/ >>>2 /Unknown flag: --daily/
>>>=1 >>>=1
# 12. help and input flags can go before command # 12. help and input flags can go before command
hledgerdev -f /dev/null --alias somealiases --rules-file -? -h --help --version --debug 1 register --daily hledger -f /dev/null --alias somealiases --rules-file -? -h --help --version --debug 1 register --daily
>>> /^hledger \[COMMAND\]/ >>> /^hledger \[COMMAND\]/
>>>=0 >>>=0
# 13. or after it, and spaces in options are optional # 13. or after it, and spaces in options are optional
hledgerdev register -f/dev/null --alias=somealiases --rules-file -? -h --help --version --debug 1 --daily hledger register -f/dev/null --alias=somealiases --rules-file -? -h --help --version --debug 1 --daily
>>> /^register \[OPTIONS\]/ >>> /^register \[OPTIONS\]/
>>>=0 >>>=0

View File

@ -1,5 +1,5 @@
# 1. all data files on the command line should be read # 1. all data files on the command line should be read
hledgerdev inc -f personal.journal -f business.journal hledger inc -f personal.journal -f business.journal
>>> >>>
Income Statement Income Statement
@ -21,7 +21,7 @@ Total:
>>>=0 >>>=0
# 2. aliases in files should only apply to later files # 2. aliases in files should only apply to later files
hledgerdev print -f personal.journal -f business.journal -f alias.journal -f personal.journal hledger print -f personal.journal -f business.journal -f alias.journal -f personal.journal
>>> >>>
2014/01/01 2014/01/01
expenses:office supplies $1 expenses:office supplies $1

View File

@ -1,12 +1,12 @@
# commands should generally autocreate an empty journal when missing, see also add*.test # commands should generally autocreate an empty journal when missing, see also add*.test
# $$ used for safe concurrent test running, may be a bash-ism # $$ used for safe concurrent test running, may be a bash-ism
hledgerdev register -f no-such-file-$$; rm -f no-such-file-$$ hledger register -f no-such-file-$$; rm -f no-such-file-$$
>>> >>>
>>>2 /journal file.*not found/ >>>2 /journal file.*not found/
>>>=0 >>>=0
hledgerdev balance --no-total -f no-such-file-$$; rm -f no-such-file-$$ hledger balance --no-total -f no-such-file-$$; rm -f no-such-file-$$
>>> >>>
>>>2 /journal file.*not found/ >>>2 /journal file.*not found/
>>>=0 >>>=0

View File

@ -1,5 +1,5 @@
# 1. account pattern with space # 1. account pattern with space
hledgerdev -f- register 'a a' hledger -f- register 'a a'
<<< <<<
2010/3/1 x 2010/3/1 x
a a 1 a a 1
@ -10,7 +10,7 @@ hledgerdev -f- register 'a a'
# #
# 2. description pattern with space # 2. description pattern with space
hledgerdev -f- register desc:'x x' hledger -f- register desc:'x x'
<<< <<<
2010/3/1 x 2010/3/1 x
a 1 a 1
@ -26,7 +26,7 @@ hledgerdev -f- register desc:'x x'
# #
# 3. multiple patterns, spaced and punctuated patterns # 3. multiple patterns, spaced and punctuated patterns
hledgerdev -f- register 'a a' "'b" hledger -f- register 'a a' "'b"
<<< <<<
2011/9/11 2011/9/11
a a 1 a a 1

View File

@ -1,5 +1,5 @@
# 1. read CSV to hledger journal format # 1. read CSV to hledger journal format
rm -rf t.rules$$; printf 'fields date, description, amount\ndate-format %%d/%%Y/%%m\ncurrency $\naccount1 assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledgerdev -f- print --rules-file t.rules$$; rm -rf t.rules$$ rm -rf t.rules$$; printf 'fields date, description, amount\ndate-format %%d/%%Y/%%m\ncurrency $\naccount1 assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledger -f- print --rules-file t.rules$$; rm -rf t.rules$$
>>> >>>
2009/09/10 Flubber Co 2009/09/10 Flubber Co
income:unknown $-50 income:unknown $-50
@ -9,7 +9,7 @@
>>>=0 >>>=0
# 2. reading CSV with in-field and out-field # 2. reading CSV with in-field and out-field
printf 'account1 Assets:MyAccount\ndate %%1\ndate-format %%d/%%Y/%%m\ndescription %%2\namount-in %%3\namount-out %%4\ncurrency $\n' >$$.rules ; hledgerdev -f- print --rules-file $$.rules; rm -rf $$.rules printf 'account1 Assets:MyAccount\ndate %%1\ndate-format %%d/%%Y/%%m\ndescription %%2\namount-in %%3\namount-out %%4\ncurrency $\n' >$$.rules ; hledger -f- print --rules-file $$.rules; rm -rf $$.rules
<<< <<<
10/2009/09,Flubber Co,50, 10/2009/09,Flubber Co,50,
11/2009/09,Flubber Co,,50 11/2009/09,Flubber Co,,50
@ -26,7 +26,7 @@
>>>=0 >>>=0
# 3. report rules parse error # 3. report rules parse error
# rm -rf t.rules$$; printf 'date-fiel 0\ndate-format %%d/%%Y/%%m\ndescription-field 1\namount-field 2\ncurrency $\nbase-account assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledgerdev convert --rules-file t.rules$$; rm -rf t.rules$$ # rm -rf t.rules$$; printf 'date-fiel 0\ndate-format %%d/%%Y/%%m\ndescription-field 1\namount-field 2\ncurrency $\nbase-account assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledger convert --rules-file t.rules$$; rm -rf t.rules$$
# >>> # >>>
# 2009/09/10 Flubber Co # 2009/09/10 Flubber Co
# income:unknown $-50 # income:unknown $-50
@ -36,7 +36,7 @@
# >>>=0 # >>>=0
# 4. handle conditions assigning multiple fields # 4. handle conditions assigning multiple fields
rm -rf t.rules$$; printf 'fields date, description, amount\ndate-format %%d/%%Y/%%m\ncurrency $\naccount1 assets:myacct\nif Flubber\n account2 acct\n comment cmt' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledgerdev -f- print --rules-file t.rules$$; rm -rf t.rules$$ rm -rf t.rules$$; printf 'fields date, description, amount\ndate-format %%d/%%Y/%%m\ncurrency $\naccount1 assets:myacct\nif Flubber\n account2 acct\n comment cmt' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledger -f- print --rules-file t.rules$$; rm -rf t.rules$$
>>> >>>
2009/09/10 Flubber Co ; cmt 2009/09/10 Flubber Co ; cmt
acct $-50 acct $-50

View File

@ -1,6 +1,6 @@
#!/usr/bin/env shelltest #!/usr/bin/env shelltest
# 1. test some balance assertions # 1. test some balance assertions
hledgerdev -f - stats hledger -f - stats
<<< <<<
2013/1/1 2013/1/1
a $1 =$1 a $1 =$1
@ -20,7 +20,7 @@ hledgerdev -f - stats
>>>=0 >>>=0
# 2. same entries as 1 but different parse order, assertion should still pass based on date # 2. same entries as 1 but different parse order, assertion should still pass based on date
hledgerdev -f - stats hledger -f - stats
<<< <<<
2013/1/1 2013/1/1
a $1 =$1 a $1 =$1
@ -41,7 +41,7 @@ hledgerdev -f - stats
# 3. like 1 but switch order of postings in last entry, # 3. like 1 but switch order of postings in last entry,
# assertion should fail and exit code should be non zero # assertion should fail and exit code should be non zero
hledgerdev -f - stats hledger -f - stats
<<< <<<
2013/1/1 2013/1/1
a $1 =$1 a $1 =$1
@ -61,7 +61,7 @@ hledgerdev -f - stats
>>>=1 >>>=1
# 4. should also work without commodity symbols # 4. should also work without commodity symbols
hledgerdev -f - stats hledger -f - stats
<<< <<<
2013/1/1 2013/1/1
(a) 1 =1 (a) 1 =1
@ -71,7 +71,7 @@ hledgerdev -f - stats
>>>=0 >>>=0
# 5. should work for fractional amount with trailing zeros # 5. should work for fractional amount with trailing zeros
hledgerdev -f - stats hledger -f - stats
<<< <<<
2013/1/1 2013/1/1
a $1.20 =$1.20 a $1.20 =$1.20
@ -90,7 +90,7 @@ hledgerdev -f - stats
>>>=0 >>>=0
# 6. assertions currently check only a single commodity's balance, like Ledger # 6. assertions currently check only a single commodity's balance, like Ledger
hledgerdev -f - stats hledger -f - stats
<<< <<<
1/2 1/2
(a) A1 (a) A1
@ -102,7 +102,7 @@ hledgerdev -f - stats
>>>=0 >>>=0
# 7. balances should accumulate (#195) # 7. balances should accumulate (#195)
hledgerdev -f - stats hledger -f - stats
<<< <<<
1/1 1/1
(a) 1F = 1F (a) 1F = 1F
@ -118,7 +118,7 @@ hledgerdev -f - stats
# in a, 3.4 EUR @@ $5.6 and -3.4 EUR cancel out (wrong ?) # in a, 3.4 EUR @@ $5.6 and -3.4 EUR cancel out (wrong ?)
# in b, # in b,
# #
# hledgerdev -f - stats # hledger -f - stats
# <<< # <<<
# 2013/1/1 # 2013/1/1
# a $1.20 # a $1.20

View File

@ -1,5 +1,5 @@
# 1. accept a blank description # 1. accept a blank description
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 2010/1/1
a 1 a 1
@ -8,7 +8,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 2. same, but no separator space after the date # 2. same, but no separator space after the date
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 2010/1/1
a 1 a 1

View File

@ -1,7 +1,7 @@
# comment tests # comment tests
# 1. # 1.
hledgerdev -f - print hledger -f - print
<<< <<<
2009/01/01 x 2009/01/01 x
; transaction comment 1 ; transaction comment 1
@ -18,7 +18,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 2. # 2.
hledgerdev -f - print hledger -f - print
<<< <<<
2009/01/01 x 2009/01/01 x
a 1 a 1
@ -32,7 +32,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 3. print should preserve transaction (entry) comments and which line they're on # 3. print should preserve transaction (entry) comments and which line they're on
hledgerdev -f - print hledger -f - print
<<< <<<
; leading journal comment, not preserved ; leading journal comment, not preserved
@ -58,7 +58,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 4. a posting comment should appear in print # 4. a posting comment should appear in print
hledgerdev -f - print hledger -f - print
<<< <<<
2010/01/01 x 2010/01/01 x
a 1 ; comment a 1 ; comment
@ -73,7 +73,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 5. a posting comment should not appear in register # 5. a posting comment should not appear in register
hledgerdev -f - register hledger -f - register
<<< <<<
2010/1/1 x 2010/1/1 x
a 1 ; comment a 1 ; comment

View File

@ -1,6 +1,6 @@
# invalid dates should be rejected # invalid dates should be rejected
# 1. valid month and day, but flipped # 1. valid month and day, but flipped
hledgerdev -f- print hledger -f- print
<<< <<<
2010/31/12 x 2010/31/12 x
a 1 a 1
@ -8,7 +8,7 @@ hledgerdev -f- print
>>>2 /bad date/ >>>2 /bad date/
>>>= 1 >>>= 1
# 2. too-large day # 2. too-large day
hledgerdev -f- print hledger -f- print
<<< <<<
2010/12/32 x 2010/12/32 x
a 1 a 1
@ -16,7 +16,7 @@ hledgerdev -f- print
>>>2 /bad date/ >>>2 /bad date/
>>>= 1 >>>= 1
# 3. 29th feb on leap year should be ok # 3. 29th feb on leap year should be ok
hledgerdev -f- print hledger -f- print
<<< <<<
2000/2/29 x 2000/2/29 x
a 1 a 1
@ -28,7 +28,7 @@ hledgerdev -f- print
>>>= 0 >>>= 0
# 4. 29th feb on non-leap year should fail # 4. 29th feb on non-leap year should fail
hledgerdev -f- print hledger -f- print
<<< <<<
2001/2/29 x 2001/2/29 x
a 1 a 1
@ -36,14 +36,14 @@ hledgerdev -f- print
>>>2 /bad date/ >>>2 /bad date/
>>>= 1 >>>= 1
# 5. dates should be followed by whitespace or newline # 5. dates should be followed by whitespace or newline
hledgerdev -f- print hledger -f- print
<<< <<<
2015/9/6: 2015/9/6:
a 0 a 0
>>>2 /unexpected ":"/ >>>2 /unexpected ":"/
>>>= 1 >>>= 1
# 6. # 6.
hledgerdev -f- print hledger -f- print
<<< <<<
2015/9/6=9/6* x 2015/9/6=9/6* x
a 0 a 0

View File

@ -4,7 +4,7 @@
# display style for the commodity. # display style for the commodity.
# 1. no default commodity # 1. no default commodity
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 2010/1/1
a 1000 a 1000
@ -17,7 +17,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 2. pound, two decimal places, no digit group separator # 2. pound, two decimal places, no digit group separator
hledgerdev -f- print hledger -f- print
<<< <<<
D £1000.00 D £1000.00
2010/1/1 2010/1/1
@ -31,7 +31,7 @@ D £1000.00
>>>=0 >>>=0
# 3. dollar, comma decimal point, three decimal places, no digit group separator # 3. dollar, comma decimal point, three decimal places, no digit group separator
hledgerdev -f- print hledger -f- print
<<< <<<
D $1,000 D $1,000
2010/1/1 2010/1/1
@ -45,7 +45,7 @@ D $1,000
>>>=0 >>>=0
# 4. dollar, three digit group separator, one decimal place # 4. dollar, three digit group separator, one decimal place
hledgerdev -f- print hledger -f- print
<<< <<<
D $1,000.0 D $1,000.0
2010/1/1 2010/1/1
@ -59,7 +59,7 @@ D $1,000.0
# 5. commodity and display style applied to the second posting amount.. # 5. commodity and display style applied to the second posting amount..
# which ends up setting the digit group style, since it's the first amount # which ends up setting the digit group style, since it's the first amount
# with digit groups. The great precision is used. # with digit groups. The great precision is used.
hledgerdev -f- print hledger -f- print
<<< <<<
D $1,000.0 D $1,000.0
2010/1/1 2010/1/1

View File

@ -1,5 +1,5 @@
# nested includes in subdirectories # nested includes in subdirectories
mkdir -p b/c/d ; printf '2010/1/1\n (D) 1\n' >b/c/d/d.journal ; printf '2010/1/1\n (C) 1\n!include d/d.journal\n' >b/c/c.journal ; printf '2010/1/1\n (B) 1\n!include c/c.journal\n' >b/b.journal ; printf '2010/1/1\n (A) 1\n!include b/b.journal\n' >a.journal ; hledgerdev -f a.journal print; rm -rf a.journal b mkdir -p b/c/d ; printf '2010/1/1\n (D) 1\n' >b/c/d/d.journal ; printf '2010/1/1\n (C) 1\n!include d/d.journal\n' >b/c/c.journal ; printf '2010/1/1\n (B) 1\n!include c/c.journal\n' >b/b.journal ; printf '2010/1/1\n (A) 1\n!include b/b.journal\n' >a.journal ; hledger -f a.journal print; rm -rf a.journal b
>>> >>>
2010/01/01 2010/01/01
(A) 1 (A) 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - print hledger -f - print
<<< <<<
2009-01-01 x 2009-01-01 x
a 2 a 2

View File

@ -1,5 +1,5 @@
# can we parse this sample journal from c++ ledger source # can we parse this sample journal from c++ ledger source
hledgerdev -f- stats hledger -f- stats
<<< <<<
; -*- ledger -*- ; -*- ledger -*-

View File

@ -1,5 +1,5 @@
# 1. the status field can contain nothing, # 1. the status field can contain nothing,
hledgerdev -f- print hledger -f- print
<<< <<<
2015/1/1 x 2015/1/1 x
(a) 1 (a) 1
@ -10,7 +10,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 2. or ! # 2. or !
hledgerdev -f- print hledger -f- print
<<< <<<
2015/1/1 ! x 2015/1/1 ! x
(a) 1 (a) 1
@ -21,7 +21,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 3. or * # 3. or *
hledgerdev -f- print hledger -f- print
<<< <<<
2015/1/1 * x 2015/1/1 * x
(a) 1 (a) 1
@ -32,7 +32,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 4. --cleared matches * only # 4. --cleared matches * only
hledgerdev -f- print --cleared hledger -f- print --cleared
<<< <<<
2015/1/1 x 2015/1/1 x
(a) 1 (a) 1
@ -47,7 +47,7 @@ hledgerdev -f- print --cleared
>>>=0 >>>=0
# 5. --pending matches ! only # 5. --pending matches ! only
hledgerdev -f- print --pending hledger -f- print --pending
<<< <<<
2015/1/1 x 2015/1/1 x
(a) 1 (a) 1
@ -62,7 +62,7 @@ hledgerdev -f- print --pending
>>>=0 >>>=0
# 6. --uncleared matches all except * # 6. --uncleared matches all except *
hledgerdev -f- print --uncleared hledger -f- print --uncleared
<<< <<<
2015/1/1 x 2015/1/1 x
(a) 1 (a) 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - register hledger -f - register
<<< <<<
2009/1/1 a 2009/1/1 a
b 1.1 b 1.1

View File

@ -3,7 +3,7 @@
# simple aliases # simple aliases
# simple alias directive # simple alias directive
hledgerdev -f- accounts hledger -f- accounts
<<< <<<
alias checking = assets:bank:checking alias checking = assets:bank:checking
1/1 1/1
@ -13,7 +13,7 @@ assets:bank:checking:a
>>>=0 >>>=0
# simple alias matches whole account name components only # simple alias matches whole account name components only
hledgerdev -f- accounts hledger -f- accounts
<<< <<<
alias a:b = A:B alias a:b = A:B
1/1 1/1
@ -26,7 +26,7 @@ a:bb:d
>>>=0 >>>=0
# a simple alias matching the whole account name works # a simple alias matching the whole account name works
hledgerdev -f- accounts hledger -f- accounts
<<< <<<
alias a:b = A:B alias a:b = A:B
1/1 1/1
@ -38,7 +38,7 @@ A:B
# regular expression aliases # regular expression aliases
# regex alias directive # regex alias directive
hledgerdev -f- accounts hledger -f- accounts
<<< <<<
alias /^(.+):bank:([^:]+):?(.*)/ = \1:\2 \3 alias /^(.+):bank:([^:]+):?(.*)/ = \1:\2 \3
1/1 1/1
@ -53,7 +53,7 @@ assets:B checking:a
# replacement can replace multiple matches within the account name. # replacement can replace multiple matches within the account name.
# The replacement pattern supports numeric backreferences. # The replacement pattern supports numeric backreferences.
# #
hledgerdev -f- print hledger -f- print
<<< <<<
alias /a/ = b alias /a/ = b
@ -87,7 +87,7 @@ alias /A (.)/=\1
# --alias command-line options are applied in the order written. # --alias command-line options are applied in the order written.
# Spaces are allowed if quoted. # Spaces are allowed if quoted.
# #
hledgerdev -f- print --alias '/A (.)/=a' --alias /a/=b hledger -f- print --alias '/A (.)/=a' --alias /a/=b
<<< <<<
2011/01/01 2011/01/01
a a 1 a a 1
@ -104,7 +104,7 @@ hledgerdev -f- print --alias '/A (.)/=a' --alias /a/=b
# alias options are applied after alias directives. # alias options are applied after alias directives.
# #
hledgerdev -f- print --alias /a/=A --alias /B/=C --alias /B/=D --alias /C/=D hledger -f- print --alias /a/=A --alias /B/=C --alias /B/=D --alias /C/=D
<<< <<<
alias /^a/=B alias /^a/=B
alias /^a/=E alias /^a/=E

View File

@ -1,6 +1,6 @@
# amount layout tests, using default vertical layout # amount layout tests, using default vertical layout
# 1. print # 1. print
hledgerdev -f - print hledger -f - print
<<< <<<
2010/1/1 2010/1/1
a EUR 1 ; a euro a EUR 1 ; a euro
@ -16,7 +16,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 2. register # 2. register
hledgerdev -f - register hledger -f - register
<<< <<<
2010/1/1 2010/1/1
a EUR 1 ; a euro a EUR 1 ; a euro
@ -31,7 +31,7 @@ hledgerdev -f - register
>>>=0 >>>=0
# 3. balance # 3. balance
hledgerdev -f - balance hledger -f - balance
<<< <<<
2010/1/1 2010/1/1
a EUR 1 ; a euro a EUR 1 ; a euro
@ -48,7 +48,7 @@ hledgerdev -f - balance
# 4. a zero amount is always displayed as just "0", regardless of any commodity/decimal places/price (like ledger) # 4. a zero amount is always displayed as just "0", regardless of any commodity/decimal places/price (like ledger)
# #
hledgerdev -f- print --empty hledger -f- print --empty
<<< <<<
2010/3/1 x 2010/3/1 x
a $0.00 @ 3EUR a $0.00 @ 3EUR
@ -62,7 +62,7 @@ hledgerdev -f- print --empty
# 5. mixed amounts with prices # 5. mixed amounts with prices
# XXX # XXX
# hledgerdev -f - print # hledger -f - print
# <<< # <<<
# 2010/1/1 # 2010/1/1
# a EUR 1 @ USD 1.1 ; a euro # a EUR 1 @ USD 1.1 ; a euro
@ -84,7 +84,7 @@ hledgerdev -f- print --empty
#>>>=0 #>>>=0
# #
# # # #
# hledgerdev -f - register # hledger -f - register
# <<< # <<<
# 2010/1/1 # 2010/1/1
# a EUR 1 @ USD 1.1 ; a euro # a EUR 1 @ USD 1.1 ; a euro
@ -99,7 +99,7 @@ hledgerdev -f- print --empty
#>>>=0 #>>>=0
# #
# # # #
# hledgerdev -f - balance # hledger -f - balance
# <<< # <<<
# 2010/1/1 # 2010/1/1
# a EUR 1 @ USD 1.1 ; a euro # a EUR 1 @ USD 1.1 ; a euro

View File

@ -1,6 +1,6 @@
# a commodity may contain/end with numbers, if double quoted # a commodity may contain/end with numbers, if double quoted
# 1. without quotes, fail. XXX parse error should be clearer here # 1. without quotes, fail. XXX parse error should be clearer here
hledgerdev -f- print hledger -f- print
<<< <<<
2010-04-05 x 2010-04-05 x
a 10 DE0002635307 a 10 DE0002635307
@ -8,7 +8,7 @@ hledgerdev -f- print
>>>2 /unexpected/ >>>2 /unexpected/
>>>= 1 >>>= 1
# 2. with quotes, ok; quotes appear in print output # 2. with quotes, ok; quotes appear in print output
hledgerdev -f- print hledger -f- print
<<< <<<
2010-04-05 x 2010-04-05 x
a 10 "DE 0002 635307" a 10 "DE 0002 635307"
@ -21,7 +21,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 3. and in other reports too, I guess # 3. and in other reports too, I guess
hledgerdev -f- balance hledger -f- balance
<<< <<<
2010-04-05 x 2010-04-05 x
a 10 "DE0002635307" a 10 "DE0002635307"

View File

@ -2,7 +2,7 @@
# #
# 1. original test case, this should balance since price precisions do # 1. original test case, this should balance since price precisions do
# not affect the canonical display precisions used for display and balancing # not affect the canonical display precisions used for display and balancing
hledgerdev -f - print hledger -f - print
<<< <<<
2010/1/1 x 2010/1/1 x
A 55.3653 C @ 30.92189512 D A 55.3653 C @ 30.92189512 D
@ -16,7 +16,7 @@ hledgerdev -f - print
## 1b. here $'s canonical display precision should be 2 not 4 ## 1b. here $'s canonical display precision should be 2 not 4
## XXX no, because the inferred amount $1.0049 is observed ## XXX no, because the inferred amount $1.0049 is observed
# hledgerdev -f - print --cost # hledger -f - print --cost
# <<< # <<<
# 2010/1/1 # 2010/1/1
# a $0.00 # a $0.00
@ -32,7 +32,7 @@ hledgerdev -f - print
# 2. and here the price should be printed with its original precision, not # 2. and here the price should be printed with its original precision, not
# the canonical display precision # the canonical display precision
hledgerdev -f - print hledger -f - print
<<< <<<
2010/1/1 2010/1/1
a $0.00 a $0.00
@ -48,7 +48,7 @@ hledgerdev -f - print
# 3. with $'s display precision at 3 or more, this txn should not balance. # 3. with $'s display precision at 3 or more, this txn should not balance.
# The error message shows the difference with full precision. # The error message shows the difference with full precision.
hledgerdev -f - balance --no-total --cost --empty hledger -f - balance --no-total --cost --empty
<<< <<<
2010/1/1 2010/1/1
a 1C @ $1.0049 a 1C @ $1.0049
@ -57,7 +57,7 @@ hledgerdev -f - balance --no-total --cost --empty
>>>= 1 >>>= 1
# 4. with $'s display precision at 2 or less, this txn should balance # 4. with $'s display precision at 2 or less, this txn should balance
hledgerdev -f - balance --no-total --cost --empty hledger -f - balance --no-total --cost --empty
<<< <<<
2010/1/1 2010/1/1
a 1C @ $1.0049 a 1C @ $1.0049
@ -67,7 +67,7 @@ hledgerdev -f - balance --no-total --cost --empty
>>>=0 >>>=0
# 5. avamk's 2011/1/19 example # 5. avamk's 2011/1/19 example
hledgerdev -f - balance --cost hledger -f - balance --cost
<<< <<<
2001/01/01 * ACME fund 2001/01/01 * ACME fund
assets:investment:ACME 203.890 ACME @ $16.02 assets:investment:ACME 203.890 ACME @ $16.02
@ -96,7 +96,7 @@ hledgerdev -f - balance --cost
# 0 # 0
## 6. with a default commodity.. XXX should observe it ## 6. with a default commodity.. XXX should observe it
hledgerdev -f - balance --cost hledger -f - balance --cost
<<< <<<
D $1000.0 D $1000.0
2001/01/01 * ACME fund 2001/01/01 * ACME fund
@ -130,7 +130,7 @@ D $1000.0
# the max precisions of the commodities being converted (#262). # the max precisions of the commodities being converted (#262).
# Here the (irrational) price should be displayed with just precision 4 # Here the (irrational) price should be displayed with just precision 4
# (C's precision 2 + D's precision 2). # (C's precision 2 + D's precision 2).
hledgerdev -f- print hledger -f- print
<<< <<<
1/1 1/1
c C 10.00 c C 10.00
@ -147,7 +147,7 @@ hledgerdev -f- print
## 8. Here the price should be displayed with precision 7 ## 8. Here the price should be displayed with precision 7
# (E's precision 4 + F's precision 3). # (E's precision 4 + F's precision 3).
hledgerdev -f- print hledger -f- print
<<< <<<
1/1 1/1
e E 10.0000 e E 10.0000

View File

@ -1,6 +1,6 @@
# price-related tests # price-related tests
# 1. print a transaction with an explicit unit price # 1. print a transaction with an explicit unit price
hledgerdev -f- print hledger -f- print
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €100 @ $1.35 expenses:foreign currency €100 @ $1.35
@ -13,7 +13,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# 2. -B/--cost converts to the price's commodity ("cost") # 2. -B/--cost converts to the price's commodity ("cost")
hledgerdev -f- print --cost hledger -f- print --cost
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €100 @ $1.35 expenses:foreign currency €100 @ $1.35
@ -26,7 +26,7 @@ hledgerdev -f- print --cost
>>>=0 >>>=0
# 3. -B should ignore historical price directives # 3. -B should ignore historical price directives
hledgerdev -f- print -B hledger -f- print -B
<<< <<<
P 2011/01/01 € $1.35 P 2011/01/01 € $1.35
@ -42,7 +42,7 @@ P 2011/01/01 € $1.35
>>>=0 >>>=0
# 4. print a transaction with a total price # 4. print a transaction with a total price
hledgerdev -f - print hledger -f - print
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €100 @@ $135 expenses:foreign currency €100 @@ $135
@ -56,7 +56,7 @@ hledgerdev -f - print
# 5. when the balance has exactly two commodities, both unpriced, infer an # 5. when the balance has exactly two commodities, both unpriced, infer an
# implicit conversion price for the first one in terms of the second. # implicit conversion price for the first one in terms of the second.
hledgerdev -f - print hledger -f - print
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €100 expenses:foreign currency €100
@ -77,7 +77,7 @@ hledgerdev -f - print
>>>=0 >>>=0
## 6. another, from ledger tests. Just one posting to price so uses @@. ## 6. another, from ledger tests. Just one posting to price so uses @@.
hledgerdev -f - print hledger -f - print
<<< <<<
2002/09/30 * 1a1a6305d06ce4b284dba0d267c23f69d70c20be 2002/09/30 * 1a1a6305d06ce4b284dba0d267c23f69d70c20be
c56a21d23a6535184e7152ee138c28974f14280c 866.231000 GGGGG c56a21d23a6535184e7152ee138c28974f14280c 866.231000 GGGGG
@ -90,7 +90,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 7. when the balance has more than two commodities, don't bother # 7. when the balance has more than two commodities, don't bother
hledgerdev -f - print hledger -f - print
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €100 expenses:foreign currency €100
@ -99,7 +99,7 @@ hledgerdev -f - print
>>>= !0 >>>= !0
# 8. another # 8. another
hledgerdev -f - balance -B hledger -f - balance -B
<<< <<<
2011/01/01 2011/01/01
expenses:foreign currency €99 expenses:foreign currency €99
@ -114,7 +114,7 @@ hledgerdev -f - balance -B
>>>=0 >>>=0
# 9. transaction in two commodities should balance out properly # 9. transaction in two commodities should balance out properly
hledgerdev -f - balance --cost hledger -f - balance --cost
<<< <<<
2011/01/01 x 2011/01/01 x
a 10£ @@ 16$ a 10£ @@ 16$
@ -129,7 +129,7 @@ hledgerdev -f - balance --cost
# 10. When commodity price is specified implicitly, transaction should # 10. When commodity price is specified implicitly, transaction should
# be considered balanced out even when first amount is negative # be considered balanced out even when first amount is negative
# (that is, price for it should be determined properly, with proper sign) # (that is, price for it should be determined properly, with proper sign)
hledgerdev -f - balance hledger -f - balance
<<< <<<
2011/01/01 x 2011/01/01 x
a -10£ a -10£
@ -144,7 +144,7 @@ hledgerdev -f - balance
# 11. When commodity price is specified implicitly, transaction should # 11. When commodity price is specified implicitly, transaction should
# NOT be considered balanced out when BOTH amounts are negative # NOT be considered balanced out when BOTH amounts are negative
hledgerdev -f - balance hledger -f - balance
<<< <<<
2011/01/01 x 2011/01/01 x
a -10£ a -10£
@ -153,7 +153,7 @@ hledgerdev -f - balance
>>>=1 >>>=1
# 12. Differently-priced lots of a commodity should be merged in balance report # 12. Differently-priced lots of a commodity should be merged in balance report
hledgerdev -f - balance hledger -f - balance
<<< <<<
2011/1/1 2011/1/1
(a) £1 @ $2 (a) £1 @ $2
@ -167,7 +167,7 @@ hledgerdev -f - balance
>>>=0 >>>=0
# 13. this should balance # 13. this should balance
hledgerdev -f - balance hledger -f - balance
<<< <<<
2011/1/1 2011/1/1
a 1h @ $10 a 1h @ $10
@ -176,7 +176,7 @@ hledgerdev -f - balance
>>>= 0 >>>= 0
# 14. we ignore P, so this should balance # 14. we ignore P, so this should balance
hledgerdev -f - balance hledger -f - balance
<<< <<<
P 2011/11/15 EUR CHF 1 P 2011/11/15 EUR CHF 1
2011/11/19 2011/11/19
@ -185,7 +185,7 @@ P 2011/11/15 EUR CHF 1
>>>= 0 >>>= 0
# # 14b. if P worked, this should balance # # 14b. if P worked, this should balance
# hledgerdev -f - balance # hledger -f - balance
# <<< # <<<
# P 2011/11/15 EUR CHF 1.234 # P 2011/11/15 EUR CHF 1.234
# 2011/11/19 # 2011/11/19
@ -195,7 +195,7 @@ P 2011/11/15 EUR CHF 1
# >>>= 0 # >>>= 0
# 15. these balance because of the unit prices, and should parse successfully # 15. these balance because of the unit prices, and should parse successfully
hledgerdev -f - balance --no-total hledger -f - balance --no-total
<<< <<<
1/1 1/1
a 1X @ 2Y a 1X @ 2Y
@ -205,7 +205,7 @@ hledgerdev -f - balance --no-total
>>>= 0 >>>= 0
# 16. # 16.
hledgerdev -f - balance --no-total -B hledger -f - balance --no-total -B
<<< <<<
1/1 1/1
a 1X @ 2Y a 1X @ 2Y
@ -214,7 +214,7 @@ hledgerdev -f - balance --no-total -B
>>>= 0 >>>= 0
# 17. likewise with total prices. Note how the primary amount's sign is used. # 17. likewise with total prices. Note how the primary amount's sign is used.
hledgerdev -f - balance --no-total hledger -f - balance --no-total
<<< <<<
1/1 1/1
a 1X @@ 1Y a 1X @@ 1Y
@ -224,7 +224,7 @@ hledgerdev -f - balance --no-total
>>>= 0 >>>= 0
# 18. # 18.
hledgerdev -f - balance --no-total -B hledger -f - balance --no-total -B
<<< <<<
1/1 1/1
a 1X @@ 1Y a 1X @@ 1Y
@ -233,7 +233,7 @@ hledgerdev -f - balance --no-total -B
>>>= 0 >>>= 0
# 19. here, a's primary amount is 0, and its cost is 1Y; b is the assigned auto-balancing amount of -1Y (per issue 69) # 19. here, a's primary amount is 0, and its cost is 1Y; b is the assigned auto-balancing amount of -1Y (per issue 69)
hledgerdev -f - balance --no-total -E hledger -f - balance --no-total -E
<<< <<<
1/1 1/1
a 1X @@ 1Y a 1X @@ 1Y
@ -246,7 +246,7 @@ hledgerdev -f - balance --no-total -E
>>>= 0 >>>= 0
# 20. the above with -B # 20. the above with -B
hledgerdev -f - balance --no-total -E -B hledger -f - balance --no-total -E -B
<<< <<<
1/1 1/1
a 1X @@ 1Y a 1X @@ 1Y
@ -261,7 +261,7 @@ hledgerdev -f - balance --no-total -E -B
# # when the *cost-basis* balance has exactly two commodities, both # # when the *cost-basis* balance has exactly two commodities, both
# # unpriced, infer an implicit conversion price for the first one in terms # # unpriced, infer an implicit conversion price for the first one in terms
# # of the second. # # of the second.
# hledgerdev -f - print # hledger -f - print
# <<< # <<<
# 2011/01/01 # 2011/01/01
# expenses:foreign currency €100 # expenses:foreign currency €100

View File

@ -1,7 +1,7 @@
# filtering by transaction status # filtering by transaction status
# 1. with --cleared, print shows cleared transactions only # 1. with --cleared, print shows cleared transactions only
hledgerdev -f- print --cleared hledger -f- print --cleared
<<< <<<
2010/1/1 x 2010/1/1 x
a 1 a 1
@ -26,7 +26,7 @@ hledgerdev -f- print --cleared
>>>=0 >>>=0
# 2. with --uncleared, shows uncleared transactions only # 2. with --uncleared, shows uncleared transactions only
hledgerdev -f- print --uncleared hledger -f- print --uncleared
<<< <<<
2010/1/1 x 2010/1/1 x
a 1 a 1
@ -47,7 +47,7 @@ hledgerdev -f- print --uncleared
>>>=0 >>>=0
# 3. can also have per-posting cleared status # 3. can also have per-posting cleared status
hledgerdev -f- register --cleared hledger -f- register --cleared
<<< <<<
2012/1/1 2012/1/1
a 1 a 1
@ -61,7 +61,7 @@ hledgerdev -f- register --cleared
# 4. also works with balance as shown, same as ledger. Hmm. # 4. also works with balance as shown, same as ledger. Hmm.
hledgerdev -f- balance --uncleared hledger -f- balance --uncleared
<<< <<<
2012/1/1 2012/1/1
a 1 a 1

View File

@ -1,7 +1,7 @@
# 1. we parse metadata tags in transaction and posting comments. Currently, # 1. we parse metadata tags in transaction and posting comments. Currently,
# - they can be on the same line and/or separate lines # - they can be on the same line and/or separate lines
# - they are always printed on separate lines # - they are always printed on separate lines
hledgerdev -f - print hledger -f - print
<<< <<<
2010/01/01 ; txntag1: txn val 1 2010/01/01 ; txntag1: txn val 1
; txntag2: txn val 2 ; txntag2: txn val 2
@ -24,7 +24,7 @@ hledgerdev -f - print
>>>=0 >>>=0
# 2. reports can filter by tag existence # 2. reports can filter by tag existence
hledgerdev -f - print tag:foo hledger -f - print tag:foo
<<< <<<
2010/01/01 ; foo:bar 2010/01/01 ; foo:bar
a 1 a 1
@ -50,7 +50,7 @@ hledgerdev -f - print tag:foo
>>>=0 >>>=0
# 3. or tag value # 3. or tag value
hledgerdev -f - print tag:foo=bar hledger -f - print tag:foo=bar
<<< <<<
2010/01/01 ; foo:bar 2010/01/01 ; foo:bar
a 1 a 1
@ -73,7 +73,7 @@ hledgerdev -f - print tag:foo=bar
>>>=0 >>>=0
# 4. postings inherit their transaction's tags # 4. postings inherit their transaction's tags
hledgerdev -f - register tag:foo=bar hledger -f - register tag:foo=bar
<<< <<<
2010/01/01 2010/01/01
a 1 ; foo:bar a 1 ; foo:bar

View File

@ -1,5 +1,5 @@
# 1. virtual posting shouldn't affect balance # 1. virtual posting shouldn't affect balance
hledgerdev -f- print hledger -f- print
<<< <<<
2009/1/1 x 2009/1/1 x
(virtual) 100 (virtual) 100
@ -8,7 +8,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# #
# 2. balanced virtual postings should be required to balance (themselves) # 2. balanced virtual postings should be required to balance (themselves)
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 x 2010/1/1 x
[balanced virtual] 10 [balanced virtual] 10
@ -17,7 +17,7 @@ hledgerdev -f- print
>>>= !0 >>>= !0
# #
# 3. balanced virtual postings should be required to balance (themselves) # 3. balanced virtual postings should be required to balance (themselves)
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 x 2010/1/1 x
[balanced virtual] 10 [balanced virtual] 10
@ -27,7 +27,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# #
# 4. a virtual posting with implicit amount should be handled correctly # 4. a virtual posting with implicit amount should be handled correctly
hledgerdev -f- print hledger -f- print
<<< <<<
2010/1/1 x 2010/1/1 x
[a] 10 [a] 10
@ -35,7 +35,7 @@ hledgerdev -f- print
>>>=0 >>>=0
# #
# 5. real and balanced virtual postings are balanced separately, and multiple blank virtuals are ok # 5. real and balanced virtual postings are balanced separately, and multiple blank virtuals are ok
hledgerdev -f- balance hledger -f- balance
<<< <<<
2010/1/1 x 2010/1/1 x
a 1 a 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - register τράπ hledger -f - register τράπ
<<< <<<
2009-01-01 проверка 2009-01-01 проверка
τράπεζα 10 руб τράπεζα 10 руб

View File

@ -1,4 +1,4 @@
hledgerdev -f - balance hledger -f - balance
<<< <<<
2009-01-01 проверка 2009-01-01 проверка
τράπεζα 10 руб τράπεζα 10 руб

View File

@ -1,4 +1,4 @@
hledgerdev -f - register desc:аура hledger -f - register desc:аура
<<< <<<
2009-01-01 аура (cyrillic letters) 2009-01-01 аура (cyrillic letters)
bank 10 bank 10

View File

@ -1,4 +1,4 @@
hledgerdev -f - balance hledger -f - balance
<<< <<<
2009-01-01 broken entry 2009-01-01 broken entry
дебит 1 дебит 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - print hledger -f - print
<<< <<<
2009-01-01 проверка 2009-01-01 проверка
счёт:первый 1 счёт:первый 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - register hledger -f - register
<<< <<<
2009-01-01 проверка 2009-01-01 проверка
τράπεζα 10 руб τράπεζα 10 руб

View File

@ -1,5 +1,5 @@
# print shows both dates. The second's year defaults to the first's. # print shows both dates. The second's year defaults to the first's.
hledgerdev -f - print --date2 hledger -f - print --date2
<<< <<<
2009/1/1=1/2 x 2009/1/1=1/2 x
a 1 a 1
@ -13,7 +13,7 @@ hledgerdev -f - print --date2
>>>= 0 >>>= 0
# Secondary date of 29 Feb on leap year should be valid # Secondary date of 29 Feb on leap year should be valid
hledgerdev -f - print --date2 hledger -f - print --date2
<<< <<<
2001/2/27=2000/2/29 x 2001/2/27=2000/2/29 x
a 1 a 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - print hledger -f - print
<<< <<<
2009/1/1 x 2009/1/1 x
aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1 aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1

View File

@ -1,4 +1,4 @@
hledgerdev -f - print desc:x hledger -f - print desc:x
<<< <<<
2009/1/1 x 2009/1/1 x
a 1 a 1

View File

@ -1,5 +1,5 @@
# print with negative account pattern should exclude transactions containing a matched posting # print with negative account pattern should exclude transactions containing a matched posting
hledgerdev -f- print not:a hledger -f- print not:a
<<< <<<
2010/1/1 x 2010/1/1 x
a 1 a 1

View File

@ -1,5 +1,5 @@
# 1. # 1.
hledgerdev -f - register --date2 hledger -f - register --date2
<<< <<<
2009/1/1=2010/1/1 x 2009/1/1=2010/1/1 x
a 1 a 1
@ -10,7 +10,7 @@ hledgerdev -f - register --date2
>>>=0 >>>=0
# 2. -b/-e/-p match the secondary date if --date2 is present (also, the secondary date is displayed) # 2. -b/-e/-p match the secondary date if --date2 is present (also, the secondary date is displayed)
hledgerdev -f- register -p 2014/1/2 --date2 hledger -f- register -p 2014/1/2 --date2
<<< <<<
2014/1/1=1/2 2014/1/1=1/2
(a) 1 (a) 1
@ -22,7 +22,7 @@ hledgerdev -f- register -p 2014/1/2 --date2
>>>=0 >>>=0
# 3. date: matches the secondary date if --date2 is present (on the command line, at least) # 3. date: matches the secondary date if --date2 is present (on the command line, at least)
hledgerdev -f- register date:2014/1/2 --date2 hledger -f- register date:2014/1/2 --date2
<<< <<<
2014/1/1=1/2 2014/1/1=1/2
(a) 1 (a) 1
@ -34,7 +34,7 @@ hledgerdev -f- register date:2014/1/2 --date2
>>>=0 >>>=0
# 4. date2: matches the secondary date # 4. date2: matches the secondary date
hledgerdev -f- register date2:2014/1/2 hledger -f- register date2:2014/1/2
<<< <<<
2014/1/1=1/2 2014/1/1=1/2
(a) 1 (a) 1
@ -46,7 +46,7 @@ hledgerdev -f- register date2:2014/1/2
>>>=0 >>>=0
# 5. you need to add --date2 if you also want the secondary date displayed # 5. you need to add --date2 if you also want the secondary date displayed
hledgerdev -f- register date2:2014/1/2 --date2 hledger -f- register date2:2014/1/2 --date2
<<< <<<
2014/1/1=1/2 2014/1/1=1/2
(a) 1 (a) 1
@ -58,7 +58,7 @@ hledgerdev -f- register date2:2014/1/2 --date2
>>>=0 >>>=0
# 3. date2: matching is not affected by --date2 # 3. date2: matching is not affected by --date2
hledgerdev -f- register date2:2014/1/1 --date2 hledger -f- register date2:2014/1/1 --date2
<<< <<<
2014/1/1=1/2 2014/1/1=1/2
(a) 1 (a) 1

View File

@ -1,5 +1,5 @@
# 1. register --depth N matches postings as usual but clips account names to N # 1. register --depth N matches postings as usual but clips account names to N
hledgerdev -f - register aa --depth 1 hledger -f - register aa --depth 1
<<< <<<
2010/1/1 x 2010/1/1 x
a:aa:aaa 1 a:aa:aaa 1
@ -9,7 +9,7 @@ hledgerdev -f - register aa --depth 1
>>>=0 >>>=0
# 2. separate postings remain separate # 2. separate postings remain separate
hledgerdev -f - register aa --depth 2 hledger -f - register aa --depth 2
<<< <<<
2010/1/1 x 2010/1/1 x
a:aa 1 a:aa 1
@ -29,7 +29,7 @@ hledgerdev -f - register aa --depth 2
>>>=0 >>>=0
# 3. with a reporting interval, all postings are aggregated under each (clipped) account # 3. with a reporting interval, all postings are aggregated under each (clipped) account
hledgerdev -f - register aa --depth 1 --daily hledger -f - register aa --depth 1 --daily
<<< <<<
2010/1/1 x 2010/1/1 x
a:aa 1 a:aa 1
@ -48,7 +48,7 @@ hledgerdev -f - register aa --depth 1 --daily
>>>=0 >>>=0
# 4. with --cleared # 4. with --cleared
hledgerdev -f - register a --depth 1 --cleared hledger -f - register a --depth 1 --cleared
<<< <<<
2012/1/1 * 2012/1/1 *
(a:aa) 1 (a:aa) 1
@ -58,7 +58,7 @@ hledgerdev -f - register a --depth 1 --cleared
>>>=0 >>>=0
# 5. depth 0 aggregates everything into a single line # 5. depth 0 aggregates everything into a single line
hledgerdev -f - register --depth 0 --daily a b hledger -f - register --depth 0 --daily a b
<<< <<<
2010/1/1 x 2010/1/1 x
a:aa 1 a:aa 1

View File

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

View File

@ -1,4 +1,4 @@
hledgerdev -f- register date:2014/4 hledger -f- register date:2014/4
<<< <<<
2014/3/30 2014/3/30
(a) 1 (a) 1

View File

@ -1,11 +1,11 @@
# 1. empty file # 1. empty file
hledgerdev -f- stats hledger -f- stats
<<< <<<
>>> /Accounts.* 0 \(depth 0\)/ >>> /Accounts.* 0 \(depth 0\)/
>>>=0 >>>=0
# 2. included files should be listed in parse order # 2. included files should be listed in parse order
touch a.j b.j; hledgerdev -f- stats; rm -f a.j b.j touch a.j b.j; hledger -f- stats; rm -f a.j b.j
<<< <<<
include a.j include a.j
include b.j include b.j

View File

@ -1,5 +1,5 @@
# a timelog session is parsed as a similarly-named transaction with one virtual posting # a timelog session is parsed as a similarly-named transaction with one virtual posting
hledgerdev -f - print hledger -f - print
<<< <<<
i 2009/1/1 08:00:00 i 2009/1/1 08:00:00
o 2009/1/1 09:00:00 stuff on checkout record is ignored o 2009/1/1 09:00:00 stuff on checkout record is ignored