From e83d9a1e34a6a93a0313facc3d1913003d0ec98a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 10 Jun 2018 07:53:23 -0700 Subject: [PATCH] lib: test cleanups (#804) --- tests/journal/parse-errors.test | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/journal/parse-errors.test b/tests/journal/parse-errors.test index fce928f81..45fba0f52 100644 --- a/tests/journal/parse-errors.test +++ b/tests/journal/parse-errors.test @@ -13,8 +13,9 @@ expecting date separator or the rest of year or month >=1 # 2. A journal with an unbalanced transaction. -# When read from stdin, this example actually passes because hledger tries all readers -# and the timedot reader parses it (and shows two decimal places). +# When read from stdin, this example actually passes because hledger tries all readers. +# If they all failed, it would show the error from the first (journal reader). +# But in this case the timedot reader can parse it (and shows two decimal places). < 2018/1/1 a 1 @@ -23,18 +24,19 @@ $ hledger -f - bal -N > 1.00 a -# 3. If we force journal format, we get the expected error. +# 3. So in these tests we must sometimes force the desired format, like so. +# Now we see the error from the journal reader. $ hledger -f journal:- bal -N >2 /hledger: could not balance this transaction \(real postings are off by 1\)/ >=1 -# 4. A posting without two spaces between account and amount (forcing journal format). +# 4. A posting without two spaces between account and amount. < 2018/1/1 (a) 1 # hledger doesn't detect this as an error directly, it parses account name "(a) 1" here. -$ hledger -f journal:- print -x +$ hledger -f - print -x 2018/01/01 (a) 1 0