diff --git a/tests/pricing.tests b/tests/pricing.tests new file mode 100644 index 000000000..74f92025e --- /dev/null +++ b/tests/pricing.tests @@ -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 + diff --git a/tests/print-acct-pattern.test b/tests/print-acct-pattern.test new file mode 100644 index 000000000..189dc620d --- /dev/null +++ b/tests/print-acct-pattern.test @@ -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 +>>> diff --git a/tests/print-desc-pattern.test b/tests/print-desc-pattern.test new file mode 100644 index 000000000..386b0af0f --- /dev/null +++ b/tests/print-desc-pattern.test @@ -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 +