pricing, print tests

This commit is contained in:
Simon Michael 2010-04-15 22:59:22 +00:00
parent d83f6ba5e0
commit 5083255ed3
3 changed files with 73 additions and 0 deletions

51
tests/pricing.tests Normal file
View File

@ -0,0 +1,51 @@
# draft pricing tests
# 1. print a transaction with explicitly-priced amount
./hledger -f- print
<<<
2009/1/2 x
expenses:foreign currency €100 @ $1.35
assets
>>>
2009/01/02 x
expenses:foreign currency €100 @ $1.35
assets $-135.00
# 2. again, this time converting to cost basis
./hledger -f- print -B
<<<
2009/1/2 x
expenses:foreign currency €100 @ $1.35
assets
>>>
2009/01/02 x
expenses:foreign currency $135.00
assets $-135.00
# 3. same as above, but using a historical price directive
./hledger -f- print
<<<
P 2009/1/1 € $1.35
2009/1/2 x
expenses:foreign currency €100
assets
>>>
2009/01/02 x
expenses:foreign currency €100 @ $1.35
assets €-100 @ $1.35
# 4. and with conversion
./hledger -f- print -B
<<<
P 2009/1/1 € $1.35
2009/1/2 x
expenses:foreign currency €100
assets
>>>
2009/01/02 x
expenses:foreign currency $135.00
assets $-135.00

View File

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

View File

@ -0,0 +1,15 @@
./hledger -f - print desc:x
<<<
2009/1/1 x
a 1
b
2009/1/1 y
a 1
b
>>>
2009/01/01 x
a 1
b -1