tests: convert market prices tests to format 3

[ci skip]
This commit is contained in:
Simon Michael 2019-04-24 08:43:02 -07:00
parent 9d3eb8c069
commit 1d81316681

View File

@ -2,50 +2,49 @@
# http://hledger.org/hledger.html#market-value # http://hledger.org/hledger.html#market-value
# 1. Market prices are ignored by -B. # 1. Market prices are ignored by -B.
hledger -f- bal -NB <
<<<
P 2011/01/01 € $1.35 P 2011/01/01 € $1.35
2011/01/01 2011/01/01
expenses:foreign €100 expenses:foreign €100
assets assets
>>>
$ hledger -f- bal -NB
€-100 assets €-100 assets
€100 expenses:foreign €100 expenses:foreign
>>>=0
# 2. Market prices are used by bal -V. # 2. Market prices are used by bal -V.
# Market prices for other commodities are not used. # Market prices for other commodities are not used.
# Nor are transaction prices. # Nor are transaction prices.
hledger -f- bal -N -V <
<<<
P 2011/01/01 € $1.35 P 2011/01/01 € $1.35
P 2011/01/01 GBP $1.35 P 2011/01/01 GBP $1.35
2011/01/01 2011/01/01
(expenses:foreign) €100 @ $1.20 (expenses:foreign) €100 @ $1.20
>>>
$ hledger -f- bal -N -V
$135.00 expenses:foreign $135.00 expenses:foreign
>>>=0
# 3. Market prices in the future (later than today's date) are always ignored. #453, #683 # 3. Market prices in the future (later than today's date) are always ignored. #453, #683
# XXX not working right now # XXX not working right now
hledger -f- bal -N -V <
<<<
P 2000/1/1 $ €1.20 P 2000/1/1 $ €1.20
P 3000/1/1 $ €1.30 P 3000/1/1 $ €1.30
3000/01/01 3000/01/01
(a) $100 (a) $100
>>>
$ hledger -f- bal -N -V
€120.00 a €120.00 a
>>>=0
# 4. The market prices in effect at the report end date are used. # 4. The market prices in effect at the report end date are used.
# The location of price directives does not matter. # The location of price directives does not matter.
# If multiple directives have the same date, the last parsed is used. # If multiple directives have the same date, the last parsed is used.
hledger -f- bal -N -V a -e 3000/2 <
<<<
P 3000/3/1 $ €1.40 P 3000/3/1 $ €1.40
3000/01/01 3000/01/01
@ -57,27 +56,26 @@ P 3000/3/1 $ €1.40
P 2000/1/1 $ €1.20 P 2000/1/1 $ €1.20
P 3000/1/1 $ €1.35 P 3000/1/1 $ €1.35
P 3000/1/1 $ €1.30 P 3000/1/1 $ €1.30
>>>
$ hledger -f- bal -N -V a -e 3000/2
€130.00 a €130.00 a
>>>=0
# 5. Again, this time there are prices later than the journal data and # 5. Again, this time there are prices later than the journal data and
# an explicit report end date brings them into play. # an explicit report end date brings them into play.
hledger -f- bal -N -V a -e 3000/2 <
<<<
P 3000/1/1 $ €1.10 P 3000/1/1 $ €1.10
P 3000/2/1 $ €1.30 P 3000/2/1 $ €1.30
3000/01/01 3000/01/01
(a) $100 (a) $100
>>> $ hledger -f- bal -N -V a -e 3000/2
€130.00 a €130.00 a
>>>=0
# 6. Market prices interact with D directives and with amount style canonicalisation. #131 # 6. Market prices interact with D directives and with amount style canonicalisation. #131
hledger -f- balance -V <
<<<
D 1000.00 H ; declare a default commodity named H D 1000.00 H ; declare a default commodity named H
@ -90,31 +88,32 @@ P 2015/08/14 GGGG 32.39
a 0.3350 FFFF @@ 25 a 0.3350 FFFF @@ 25
a 0.7718 GGGG @@ 25 a 0.7718 GGGG @@ 25
b ; implicit balancing amount is in the cost commodity, H b ; implicit balancing amount is in the cost commodity, H
>>>
$ hledger -f- balance -V
150.48 H a 150.48 H a
-150.00 H b -150.00 H b
-------------------- --------------------
0.48 H 0.48 H
>>>=0
# 7. register: -V affects posting amounts and total. # 7. register: -V affects posting amounts and total.
hledger -f- reg -V <
<<<
P 2000/1/1 $ €1.20 P 2000/1/1 $ €1.20
2000/1/1 2000/1/1
(a) $100 (a) $100
>>>
2000/01/01 (a) €120.00 €120.00
>>>=0
# 8. print: -V affects posting amounts but not balance assertion amounts. $ hledger -f- reg -V
hledger -f- print -V 2000/01/01 (a) €120.00 €120.00
<<<
# 8. print: -V affects posting amounts but not balance assertions.
<
P 2000/1/1 $ €1.20 P 2000/1/1 $ €1.20
2000/1/1 2000/1/1
(a) $100 = $100 (a) $100 = $100
>>>
$ hledger -f- print -V
2000/01/01 2000/01/01
(a) €120.00 = $100 (a) €120.00 = $100
>>>=0 >=0