From 1389a64e999e4b189605f1f227de2dc75458bfe2 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 18 Oct 2018 16:07:38 -0400 Subject: [PATCH] tests: budget: add tests for unassignable accounts. --- tests/print/auto.test | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/print/auto.test b/tests/print/auto.test index 92cd69cac..b78258c34 100644 --- a/tests/print/auto.test +++ b/tests/print/auto.test @@ -51,7 +51,7 @@ $ hledger balance -f- --auto $-38 >= -# Balance assertions see the generated postings. +# Balance assertions see postings generated by transaction modifier rules. < = trigger (target) 10 @@ -136,3 +136,31 @@ $ hledger -f- print --auto -x >= +# Balance assignments may not be used with accounts also affected by transaction modifier rules. +< += ^expenses:foo + budget:available *-1 + assets:checking *1 + +2018/10/17 * INITIAL + budget:available $100 + equity:opening + +2018/10/17 * SOME EXPENSE + expenses:foo $50 + assets:checking + +2018/10/17 * ASSERT + budget:other + budget:available =$0 + +$ hledger print -f- --auto +>2 +hledger: cannot assign amount to account + + budget:available + +because it is also included in transaction modifiers. + +>=1 +