From cddf610a219cc973b380cb8d0aae92f407095c93 Mon Sep 17 00:00:00 2001 From: Rahix Date: Fri, 8 May 2020 11:17:47 +0200 Subject: Add regression tests for issue #1894 Add tests for wrong behavior caused by commit 49b07a1c1948 ("Correction to the way parens are parsed in query expressions") which was reverted with commit 869302ae9ce3. The bug report was issue #1894. --- test/regress/1894_1.test | 16 ++++++++++++++++ test/regress/1894_2.test | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/regress/1894_1.test create mode 100644 test/regress/1894_2.test (limited to 'test/regress') diff --git a/test/regress/1894_1.test b/test/regress/1894_1.test new file mode 100644 index 00000000..739db459 --- /dev/null +++ b/test/regress/1894_1.test @@ -0,0 +1,16 @@ += /Expenses:Transportation/ and not expr "has_tag(/NOTAX/)" + Expenses:Tax 0.2 + $account -0.2 + +2020-05-06 * Test + Expenses:Transportation 200.00 EUR + Assets:Bank -200.00 EUR + +test bal + -200.00 EUR Assets:Bank + 200.00 EUR Expenses + 40.00 EUR Tax + 160.00 EUR Transportation +-------------------- + 0 +end test diff --git a/test/regress/1894_2.test b/test/regress/1894_2.test new file mode 100644 index 00000000..e2dc7d92 --- /dev/null +++ b/test/regress/1894_2.test @@ -0,0 +1,21 @@ += ^Expenses and expr "any(account =~ /^A:Assets/ and R)" + [A:Assets:Split] (amount / 2) + [B:Assets:Split] (-amount / 2) + += ^Expenses and expr "any(account =~ /^B:Assets/ and R)" + [B:Assets:Split] (amount / 2) + [A:Assets:Split] (-amount / 2) + +2020-05-08 * Test + Expenses:Transportation 200.00 EUR + A:Assets:Checking + +test bal + -100.00 EUR A:Assets + -200.00 EUR Checking + 100.00 EUR Split + -100.00 EUR B:Assets:Split + 200.00 EUR Expenses:Transportation +-------------------- + 0 +end test -- cgit v1.2.3