Skip to content

Commit bcd1513

Browse files
committed
tests: upgrade, document print --auto tests
1 parent 080e475 commit bcd1513

File tree

1 file changed

+34
-60
lines changed

1 file changed

+34
-60
lines changed

tests/print/auto.test

Lines changed: 34 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Add proportional income tax (from documentation)
2-
hledger print -f- --auto
3-
<<<
1+
# Transaction modifier adding (unbalanced) tax postings.
2+
# print. Auto-generated postings are inserted below the matched one.
3+
<
4+
= ^income
5+
(liabilities:tax) *.33 ; income tax
6+
47
2016/1/1 paycheck
58
income:remuneration $-100
69
income:donations $-15
@@ -10,9 +13,7 @@ hledger print -f- --auto
1013
assets:cash $20
1114
assets:bank
1215

13-
= ^income
14-
(liabilities:tax) *.33 ; income tax
15-
>>>
16+
$ hledger print -f- --auto
1617
2016/01/01 paycheck
1718
income:remuneration $-100
1819
(liabilities:tax) $-33 ; income tax
@@ -24,62 +25,21 @@ hledger print -f- --auto
2425
assets:cash $20
2526
assets:bank
2627

27-
>>>2
28-
>>>=0
28+
>=
2929

30-
hledger register -f- --auto
31-
<<<
32-
2016/1/1 paycheck
33-
income:remuneration $-100
34-
income:donations $-15
35-
assets:bank
36-
37-
2016/1/1 withdraw
38-
assets:cash $20
39-
assets:bank
40-
41-
= ^income
42-
(liabilities:tax) *.33 ; income tax
43-
>>>
30+
# register
31+
$ hledger register -f- --auto
4432
2016/01/01 paycheck income:remuneration $-100 $-100
4533
(liabilities:tax) $-33 $-133
4634
income:donations $-15 $-148
4735
(liabilities:tax) $-5 $-153
4836
assets:bank $115 $-38
4937
2016/01/01 withdraw assets:cash $20 $-18
5038
assets:bank $-20 $-38
51-
>>>2
52-
>>>=0
53-
54-
hledger register -f- --auto
55-
<<<
56-
= trigger
57-
(target) 10
39+
>=
5840

59-
2018/1/1
60-
(trigger) 1
61-
(target) 1 = 11 ; this assertion would not fail, auto posting will be taken into account
62-
>>>
63-
2018/01/01 (trigger) 1 1
64-
(target) 10 11
65-
(target) 1 12
66-
>>>2
67-
>>>=0
68-
69-
hledger balance -f- --auto
70-
<<<
71-
2016/1/1 paycheck
72-
income:remuneration $-100
73-
income:donations $-15
74-
assets:bank
75-
76-
2016/1/1 withdraw
77-
assets:cash $20
78-
assets:bank
79-
80-
= ^income
81-
(liabilities:tax) *.33 ; income tax
82-
>>>
41+
# balance
42+
$ hledger balance -f- --auto
8343
$115 assets
8444
$95 bank
8545
$20 cash
@@ -89,24 +49,38 @@ hledger balance -f- --auto
8949
$-38 liabilities:tax
9050
--------------------
9151
$-38
92-
>>>2
93-
>>>=0
52+
>=
9453

95-
hledger print -f- --auto
96-
<<<
54+
# Balance assertions see the generated postings.
55+
<
56+
= trigger
57+
(target) 10
58+
59+
2018/1/1
60+
(trigger) 1
61+
(target) 1 = 11 ; this assertion would not fail, auto posting will be taken into account
62+
63+
$ hledger register -f- --auto
64+
2018/01/01 (trigger) 1 1
65+
(target) 10 11
66+
(target) 1 12
67+
>=
68+
69+
# Transaction modifier adding (balanced virtual) budget envelope postings.
70+
<
9771
= ^expenses:groceries
9872
[budget:groceries] *-1
9973
[assets:bank:checking] *1
10074

10175
2018/10/7 * MARKET
10276
expenses:groceries:food
10377
assets:bank:checking $-20
104-
>>>
78+
79+
$ hledger print -f- --auto
10580
2018/10/07 * MARKET
10681
expenses:groceries:food
10782
[budget:groceries] $-20
10883
[assets:bank:checking] $20
10984
assets:bank:checking $-20
11085

111-
>>>2
112-
>>>=0
86+
>=

0 commit comments

Comments
 (0)