From 6314080e14fd150d2407ba356448b6124a62e2f2 Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Sun, 24 Apr 2011 22:10:30 +0000 Subject: [PATCH] Test for auto-balancing of transactions with two commodities, when first amount is negative --- tests/prices.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/prices.test b/tests/prices.test index 10fc6ac85..13b3d2159 100644 --- a/tests/prices.test +++ b/tests/prices.test @@ -146,3 +146,18 @@ bin/hledger -f - balance --cost -------------------- 0 >>>=0 +# 11. When commodity price is specified implicitly, transaction should +# be considered balanced out even when first amount is negative +# (that is, price for it should be determined properly, with proper sign) +bin/hledger -f - balance +<<< +2011/01/01 x + a -10£ + b 16$ +>>> + -10£ a + 16$ b +-------------------- + 16$ + -10£ +>>>=0