From d9ee8b23a6a8e08063b6d1e340e2d898d2c3f5e9 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 21 Jan 2011 20:52:56 +0000 Subject: [PATCH] precision tests --- tests/precision.test | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/tests/precision.test b/tests/precision.test index 5570c2d55..8eff5d90e 100644 --- a/tests/precision.test +++ b/tests/precision.test @@ -59,19 +59,52 @@ bin/hledger -f - -B bal assets:investment:ACME 203.890 ACME @ $16.02 equity:opening balances >>> -? -# hledger 0.14pre: + $3266.32 assets:investment:ACME + $-3266.32 equity:opening balances +-------------------- + $0.00 +>>>=0 +# hledger 0.14pre: precision=2, presumably from price # $3266.32 assets:investment:ACME # $-3266.32 equity:opening balances #-------------------- # $0.00 # -# ledger "2.6.0.90" (with -s): +# ledger "2.6.0.90" with -s: full precision, ignores price # $3266.3178 assets:investment:ACME # $-3266.3178 equity:opening balances # -# ledger 3: +# ledger 3: precision=0, uses default, ignores price # $3266 assets:investment:ACME # $-3266 equity:opening balances #-------------------- # 0 +## 6. with a default commodity.. XXX should observe it + + bin/hledger -f - -B balance +<<< +D $1000.0 +2001/01/01 * ACME fund + assets:investment:ACME 203.890 ACME @ $16.02 + equity:opening balances +>>> + $3266.32 assets:investment:ACME + $-3266.32 equity:opening balances +-------------------- + $0.00 +>>>=0 +### hledger 0.14pre: precision=2, presumably from price, ignores D +### $3266.32 assets:investment:ACME +### $-3266.32 equity:opening balances +###-------------------- +### $0.00 +### +### ledger "2.6.0.90" with -s: full precision, ignores price and D +### $3266.3178 assets:investment:ACME +### $-3266.3178 equity:opening balances +### +### ledger 3: precision=1, ignores price, observes D +### $3266.3 assets:investment:ACME +### $-3266.3 equity:opening balances +###-------------------- +### 0