From eeca35d6b5c5f4200b4ef853f6bef33f8c276059 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 14 Aug 2011 22:15:39 +0000 Subject: [PATCH] update functional tests to shelltest 1.0 format --- tests/add.test | 24 +++++++++++++++++------- tests/balance-custom-format.test | 1 + tests/comment-line-after-postings.test | 1 + tests/commented-posting.test | 1 + tests/convert.test | 1 + tests/decimals-balance-failure.test | 1 + tests/default-commodity.test | 1 + tests/effective-balance.test | 1 + tests/effective-print-2.test | 1 + tests/effective-print.test | 1 + tests/effective-register.test | 1 + tests/include.test | 1 + tests/metadata.test | 1 + tests/no-such-file.test | 6 ++++-- tests/parens-in-account-name.test | 1 + tests/print-acct-pattern.test | 1 + tests/print-desc-pattern.test | 1 + tests/print-long-account.test | 1 + tests/print-posting-comment.test | 1 + tests/print-preserves-comments.test | 1 + tests/register-posting-comment.test | 1 + tests/sample-balance-depth.test | 1 + tests/sample-balance-o.test | 1 + tests/sample-balance.test | 1 + tests/stats-empty-file.test | 1 + tests/unicode-account-matching.test | 1 + tests/unicode-balance.test | 1 + tests/unicode-description-matching.test | 1 + tests/unicode-print.test | 1 + tests/unicode-register.test | 1 + tests/zero-handling.test | 1 + 31 files changed, 50 insertions(+), 9 deletions(-) diff --git a/tests/add.test b/tests/add.test index bfb7990cd..3750b92e8 100644 --- a/tests/add.test +++ b/tests/add.test @@ -6,13 +6,15 @@ <<< 2009/1/32 >>> /date .*: date .*/ -# +>>>=0 + # 2. should accept a blank date rm -f add-default-commodity-$$.j; bin/hledger -f add-default-commodity-$$.j add; rm -f add-default-commodity-$$.j <<< >>> /date .*: description/ -# +>>>=0 + ############################################################################## # precision and commodity handling # @@ -27,7 +29,8 @@ b . >>> /^date \[.*\]: description \[\]: account 1: amount 1: account 2: amount 2 \[-1000.0\]: account 3: date \[.*\]: $/ -# +>>>=0 + # 4. default commodity with greater precision printf 'D $1000.00\n' >add-default-commodity-$$.j; hledger -fadd-default-commodity-$$.j add >/dev/null; cat add-default-commodity-$$.j; rm -f add-default-commodity-$$.j <<< @@ -39,7 +42,8 @@ b . >>> /a +\$1000\.0/ -# +>>>=0 + # 5. default commodity with less precision printf 'D $1000.0\n' >add-default-commodity-$$.j; hledger -fadd-default-commodity-$$.j add >/dev/null; cat add-default-commodity-$$.j; rm -f add-default-commodity-$$.j <<< @@ -51,7 +55,8 @@ b . >>> /a +\$1000\.00/ -# +>>>=0 + # 6. existing commodity with greater precision printf '2010/1/1\n a $1000.00\n b\n' >add-default-commodity-$$.j; hledger -fadd-default-commodity-$$.j add >/dev/null; cat add-default-commodity-$$.j; rm -f add-default-commodity-$$.j <<< @@ -63,7 +68,8 @@ b . >>> /a +\$1000\.0/ -# +>>>=0 + # 7. existing commodity with less precision printf '2010/1/1\n a $1000.0\n b\n' >add-default-commodity-$$.j; hledger -fadd-default-commodity-$$.j add >/dev/null; cat add-default-commodity-$$.j; rm -f add-default-commodity-$$.j <<< @@ -75,7 +81,8 @@ b . >>> /a +\$1000\.00/ -# +>>>=0 + # 8. no commodity entered, the (most recent) default commodity should be applied printf 'D $1000.0\nD £1,000.00\n' >add-default-commodity-$$.j; hledger -fadd-default-commodity-$$.j add; cat add-default-commodity-$$.j; rm -f add-default-commodity-$$.j <<< @@ -87,6 +94,8 @@ b . >>> /a +£1,000.00/ +>>>=0 + # 9. default amounts should not fail to balance due to precision bin/hledger -f nosuch.journal add <<< @@ -98,3 +107,4 @@ b 0.5 c >>> /amount 3 \[-0.75\]/ +>>>=0 diff --git a/tests/balance-custom-format.test b/tests/balance-custom-format.test index b9f74b96d..0a8068841 100644 --- a/tests/balance-custom-format.test +++ b/tests/balance-custom-format.test @@ -12,3 +12,4 @@ bin/hledger -f data/sample.journal balance --format="%30(account) %-.20(total)" liabilities:debts $1 -------------------- 0 +>>>= 0 \ No newline at end of file diff --git a/tests/comment-line-after-postings.test b/tests/comment-line-after-postings.test index 0246a7343..ba7ad664e 100644 --- a/tests/comment-line-after-postings.test +++ b/tests/comment-line-after-postings.test @@ -9,3 +9,4 @@ bin/hledger -f - print a 1 b -1 +>>>=0 diff --git a/tests/commented-posting.test b/tests/commented-posting.test index 190dbb0ee..b965f806b 100644 --- a/tests/commented-posting.test +++ b/tests/commented-posting.test @@ -9,3 +9,4 @@ bin/hledger -f - print a 1 b -1 +>>>=0 diff --git a/tests/convert.test b/tests/convert.test index 3e2a3e9d9..0057e6e42 100644 --- a/tests/convert.test +++ b/tests/convert.test @@ -7,3 +7,4 @@ rm -rf input.rules; printf 'base-account Assets:MyAccount\ndate-field 0\ndate-fo >>>2 using conversion rules file input.rules +>>>=0 diff --git a/tests/decimals-balance-failure.test b/tests/decimals-balance-failure.test index edf1f71b1..48d888cfc 100644 --- a/tests/decimals-balance-failure.test +++ b/tests/decimals-balance-failure.test @@ -7,3 +7,4 @@ bin/hledger -f - print c $-0.25 >>>2 +>>>=0 diff --git a/tests/default-commodity.test b/tests/default-commodity.test index 7d7adbfb0..5a33a8d97 100644 --- a/tests/default-commodity.test +++ b/tests/default-commodity.test @@ -36,3 +36,4 @@ D $1,000 a $1000,000 b $-1000,000 +>>>=0 diff --git a/tests/effective-balance.test b/tests/effective-balance.test index 43740a512..6068033ab 100644 --- a/tests/effective-balance.test +++ b/tests/effective-balance.test @@ -12,3 +12,4 @@ bin/hledger -f - balance -p 'in 2009' --effective -1 b -------------------- 0 +>>>=0 diff --git a/tests/effective-print-2.test b/tests/effective-print-2.test index fd69daa95..3812abc08 100644 --- a/tests/effective-print-2.test +++ b/tests/effective-print-2.test @@ -8,3 +8,4 @@ bin/hledger -f - print a 1 b -1 +>>>=0 diff --git a/tests/effective-print.test b/tests/effective-print.test index 37bb0fdbc..5fe1b21cc 100644 --- a/tests/effective-print.test +++ b/tests/effective-print.test @@ -8,3 +8,4 @@ bin/hledger -f - print --effective a 1 b -1 +>>>=0 diff --git a/tests/effective-register.test b/tests/effective-register.test index b41c0a1ca..be7c35a52 100644 --- a/tests/effective-register.test +++ b/tests/effective-register.test @@ -6,3 +6,4 @@ bin/hledger -f - register --effective >>> 2010/01/01 x a 1 1 b -1 0 +>>>=0 diff --git a/tests/include.test b/tests/include.test index 8502d3435..5da4f7827 100644 --- a/tests/include.test +++ b/tests/include.test @@ -14,3 +14,4 @@ (D) 1 >>>2 +>>>=0 diff --git a/tests/metadata.test b/tests/metadata.test index fcbb1b908..a95f7bc03 100644 --- a/tests/metadata.test +++ b/tests/metadata.test @@ -17,3 +17,4 @@ bin/hledger -f - print b -1 >>>2 +>>>=0 diff --git a/tests/no-such-file.test b/tests/no-such-file.test index 669b087f0..d23181813 100644 --- a/tests/no-such-file.test +++ b/tests/no-such-file.test @@ -1,10 +1,12 @@ # commands should generally autocreate an empty journal when missing, see also add*.test # $$ used for safe concurrent test running, may be a bash-ism -# + rm -f $$; bin/hledger register -f $$; rm -f $$ >>> >>>2 /No journal file.*creating it/ -# +>>>=0 + rm -f $$; bin/hledger balance --no-total -f $$; rm -f $$ >>> >>>2 /No journal file.*creating it/ +>>>=0 diff --git a/tests/parens-in-account-name.test b/tests/parens-in-account-name.test index cc52b22f4..4efb4aaba 100644 --- a/tests/parens-in-account-name.test +++ b/tests/parens-in-account-name.test @@ -10,3 +10,4 @@ bin/hledger -f - print b (b) b -1 c -1 +>>>=0 diff --git a/tests/print-acct-pattern.test b/tests/print-acct-pattern.test index d3bbb0de3..d7abc4fee 100644 --- a/tests/print-acct-pattern.test +++ b/tests/print-acct-pattern.test @@ -5,3 +5,4 @@ bin/hledger -f- print not:a a 1 b -1 >>> +>>>=0 diff --git a/tests/print-desc-pattern.test b/tests/print-desc-pattern.test index 9f0f94d2c..d9fa94042 100644 --- a/tests/print-desc-pattern.test +++ b/tests/print-desc-pattern.test @@ -13,3 +13,4 @@ bin/hledger -f - print desc:x a 1 b -1 +>>>=0 diff --git a/tests/print-long-account.test b/tests/print-long-account.test index 8c203b7cc..778d44bd8 100644 --- a/tests/print-long-account.test +++ b/tests/print-long-account.test @@ -8,3 +8,4 @@ bin/hledger -f - print aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1 b -1 +>>>=0 diff --git a/tests/print-posting-comment.test b/tests/print-posting-comment.test index 6a9959379..87f75256c 100644 --- a/tests/print-posting-comment.test +++ b/tests/print-posting-comment.test @@ -11,3 +11,4 @@ bin/hledger -f - print b -1 >>>2 +>>>=0 diff --git a/tests/print-preserves-comments.test b/tests/print-preserves-comments.test index 8d8d1adf0..4201f4a12 100644 --- a/tests/print-preserves-comments.test +++ b/tests/print-preserves-comments.test @@ -13,3 +13,4 @@ bin/hledger -f - print a 1 ; amount comment b -1 +>>>=0 diff --git a/tests/register-posting-comment.test b/tests/register-posting-comment.test index c4ee7b82b..34c6ffde9 100644 --- a/tests/register-posting-comment.test +++ b/tests/register-posting-comment.test @@ -9,3 +9,4 @@ bin/hledger -f - register 2010/01/01 x a 1 1 b -1 0 >>>2 +>>>=0 diff --git a/tests/sample-balance-depth.test b/tests/sample-balance-depth.test index 217c53690..bd8b2fc1e 100644 --- a/tests/sample-balance-depth.test +++ b/tests/sample-balance-depth.test @@ -6,3 +6,4 @@ bin/hledger -f data/sample.journal balance --depth 1 $1 liabilities -------------------- 0 +>>>=0 diff --git a/tests/sample-balance-o.test b/tests/sample-balance-o.test index 1de424c2f..a99a3de94 100644 --- a/tests/sample-balance-o.test +++ b/tests/sample-balance-o.test @@ -6,3 +6,4 @@ bin/hledger -f data/sample.journal balance o $-1 salary -------------------- $-1 +>>>=0 diff --git a/tests/sample-balance.test b/tests/sample-balance.test index 7208a56f4..319771bfc 100644 --- a/tests/sample-balance.test +++ b/tests/sample-balance.test @@ -12,3 +12,4 @@ bin/hledger -f data/sample.journal balance $1 liabilities:debts -------------------- 0 +>>>=0 diff --git a/tests/stats-empty-file.test b/tests/stats-empty-file.test index ba06eb8a4..4e0cb41d1 100644 --- a/tests/stats-empty-file.test +++ b/tests/stats-empty-file.test @@ -1,3 +1,4 @@ bin/hledger -f- stats <<< >>> /Accounts.* 0 \(depth 0\)/ +>>>=0 diff --git a/tests/unicode-account-matching.test b/tests/unicode-account-matching.test index 2f2369ab4..2b97c71ce 100644 --- a/tests/unicode-account-matching.test +++ b/tests/unicode-account-matching.test @@ -5,3 +5,4 @@ bin/hledger -f - register τράπ नकद >>> 2009/01/01 проверка τράπεζα 10 руб 10 руб +>>>=0 diff --git a/tests/unicode-balance.test b/tests/unicode-balance.test index e11f41cbf..102981c8f 100644 --- a/tests/unicode-balance.test +++ b/tests/unicode-balance.test @@ -8,3 +8,4 @@ bin/hledger -f - balance -10 руб नकद -------------------- 0 +>>>=0 diff --git a/tests/unicode-description-matching.test b/tests/unicode-description-matching.test index 10d6a76a9..66f58e2fb 100644 --- a/tests/unicode-description-matching.test +++ b/tests/unicode-description-matching.test @@ -9,3 +9,4 @@ bin/hledger -f - register desc:аура >>> 2009/01/01 аура (cyrillic let.. bank 10 10 cash -10 0 +>>>=0 diff --git a/tests/unicode-print.test b/tests/unicode-print.test index c9d02733c..c05534a2f 100644 --- a/tests/unicode-print.test +++ b/tests/unicode-print.test @@ -8,3 +8,4 @@ bin/hledger -f - print счёт:первый 1 счёт:второй -1 +>>>=0 diff --git a/tests/unicode-register.test b/tests/unicode-register.test index c49e1c2ae..93cc547c3 100644 --- a/tests/unicode-register.test +++ b/tests/unicode-register.test @@ -6,3 +6,4 @@ bin/hledger -f - register >>> 2009/01/01 проверка τράπεζα 10 руб 10 руб नकद -10 руб 0 +>>>=0 diff --git a/tests/zero-handling.test b/tests/zero-handling.test index 7876f7f10..47c123898 100644 --- a/tests/zero-handling.test +++ b/tests/zero-handling.test @@ -10,3 +10,4 @@ bin/hledger -f- print --empty a 0 b 0 +>>>=0