From d082b6485f371b9eae01789b245a7944535a69d2 Mon Sep 17 00:00:00 2001 From: Mitchell Kember Date: Tue, 22 Mar 2016 21:57:56 -0700 Subject: Fix Bug 1147: Check balance assertions against the amount AFTER --- test/baseline/feat-balance_assert-off.test | 2 +- test/baseline/feat-balance_assert_split.test | 4 ++-- test/regress/1147-a.test | 12 ++++++++++++ test/regress/1147-b.test | 10 ++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 test/regress/1147-a.test create mode 100644 test/regress/1147-b.test (limited to 'test') diff --git a/test/baseline/feat-balance_assert-off.test b/test/baseline/feat-balance_assert-off.test index fed24d4a..d1da753e 100644 --- a/test/baseline/feat-balance_assert-off.test +++ b/test/baseline/feat-balance_assert-off.test @@ -13,6 +13,6 @@ While parsing file "$FILE", line 8: While parsing posting: Assets:Cash -$10 = $80 ^^^ -Error: Balance assertion off by $-10 (expected to see $100) +Error: Balance assertion off by $-10 (expected to see $90) end test diff --git a/test/baseline/feat-balance_assert_split.test b/test/baseline/feat-balance_assert_split.test index 2d9cce9f..ad299325 100644 --- a/test/baseline/feat-balance_assert_split.test +++ b/test/baseline/feat-balance_assert_split.test @@ -14,7 +14,7 @@ 2012-01-04 Test ; UUID: foo - Liabilities:MasterCard $150.00 = $-300 + Liabilities:MasterCard $150.00 = $-150 2012-01-04 Test @@ -24,7 +24,7 @@ 2012-01-04 Test ; UUID: baz - Liabilities:MasterCard $150.00 = $0 + Liabilities:MasterCard $150.00 = $150 ;; b.dat diff --git a/test/regress/1147-a.test b/test/regress/1147-a.test new file mode 100644 index 00000000..e999c312 --- /dev/null +++ b/test/regress/1147-a.test @@ -0,0 +1,12 @@ +2000/01/01 Pre-transaction balance + A $5.00 = $0.00 + B + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 2: +While parsing posting: + A $5.00 = $0.00 + ^^^^^ +Error: Balance assertion off by $-5.00 (expected to see $5.00) +end test diff --git a/test/regress/1147-b.test b/test/regress/1147-b.test new file mode 100644 index 00000000..d3a1cffc --- /dev/null +++ b/test/regress/1147-b.test @@ -0,0 +1,10 @@ +2000/01/01 Post-transaction balance + A $5.00 = $5.00 + B + +test bal + $5.00 A + $-5.00 B +-------------------- + 0 +end test -- cgit v1.2.3