update functional tests to shelltest 1.0 format

This commit is contained in:
Simon Michael 2011-08-14 22:15:39 +00:00
parent 0cb0c61fcb
commit eeca35d6b5
31 changed files with 50 additions and 9 deletions

View File

@ -6,13 +6,15 @@
<<< <<<
2009/1/32 2009/1/32
>>> /date .*: date .*/ >>> /date .*: date .*/
# >>>=0
# 2. should accept a blank date # 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 rm -f add-default-commodity-$$.j; bin/hledger -f add-default-commodity-$$.j add; rm -f add-default-commodity-$$.j
<<< <<<
>>> /date .*: description/ >>> /date .*: description/
# >>>=0
############################################################################## ##############################################################################
# precision and commodity handling # precision and commodity handling
# #
@ -27,7 +29,8 @@ b
. .
>>> /^date \[.*\]: description \[\]: account 1: amount 1: account 2: amount 2 \[-1000.0\]: account 3: date \[.*\]: $/ >>> /^date \[.*\]: description \[\]: account 1: amount 1: account 2: amount 2 \[-1000.0\]: account 3: date \[.*\]: $/
# >>>=0
# 4. default commodity with greater precision # 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 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/ >>> /a +\$1000\.0/
# >>>=0
# 5. default commodity with less precision # 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 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/ >>> /a +\$1000\.00/
# >>>=0
# 6. existing commodity with greater precision # 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 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/ >>> /a +\$1000\.0/
# >>>=0
# 7. existing commodity with less precision # 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 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/ >>> /a +\$1000\.00/
# >>>=0
# 8. no commodity entered, the (most recent) default commodity should be applied # 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 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/ >>> /a +£1,000.00/
>>>=0
# 9. default amounts should not fail to balance due to precision # 9. default amounts should not fail to balance due to precision
bin/hledger -f nosuch.journal add bin/hledger -f nosuch.journal add
<<< <<<
@ -98,3 +107,4 @@ b
0.5 0.5
c c
>>> /amount 3 \[-0.75\]/ >>> /amount 3 \[-0.75\]/
>>>=0

View File

@ -12,3 +12,4 @@ bin/hledger -f data/sample.journal balance --format="%30(account) %-.20(total)"
liabilities:debts $1 liabilities:debts $1
-------------------- --------------------
0 0
>>>= 0

View File

@ -9,3 +9,4 @@ bin/hledger -f - print
a 1 a 1
b -1 b -1
>>>=0

View File

@ -9,3 +9,4 @@ bin/hledger -f - print
a 1 a 1
b -1 b -1
>>>=0

View File

@ -7,3 +7,4 @@ rm -rf input.rules; printf 'base-account Assets:MyAccount\ndate-field 0\ndate-fo
>>>2 >>>2
using conversion rules file input.rules using conversion rules file input.rules
>>>=0

View File

@ -7,3 +7,4 @@ bin/hledger -f - print
c $-0.25 c $-0.25
>>>2 >>>2
>>>=0

View File

@ -36,3 +36,4 @@ D $1,000
a $1000,000 a $1000,000
b $-1000,000 b $-1000,000
>>>=0

View File

@ -12,3 +12,4 @@ bin/hledger -f - balance -p 'in 2009' --effective
-1 b -1 b
-------------------- --------------------
0 0
>>>=0

View File

@ -8,3 +8,4 @@ bin/hledger -f - print
a 1 a 1
b -1 b -1
>>>=0

View File

@ -8,3 +8,4 @@ bin/hledger -f - print --effective
a 1 a 1
b -1 b -1
>>>=0

View File

@ -6,3 +6,4 @@ bin/hledger -f - register --effective
>>> >>>
2010/01/01 x a 1 1 2010/01/01 x a 1 1
b -1 0 b -1 0
>>>=0

View File

@ -14,3 +14,4 @@
(D) 1 (D) 1
>>>2 >>>2
>>>=0

View File

@ -17,3 +17,4 @@ bin/hledger -f - print
b -1 b -1
>>>2 >>>2
>>>=0

View File

@ -1,10 +1,12 @@
# commands should generally autocreate an empty journal when missing, see also add*.test # commands should generally autocreate an empty journal when missing, see also add*.test
# $$ used for safe concurrent test running, may be a bash-ism # $$ used for safe concurrent test running, may be a bash-ism
#
rm -f $$; bin/hledger register -f $$; rm -f $$ rm -f $$; bin/hledger register -f $$; rm -f $$
>>> >>>
>>>2 /No journal file.*creating it/ >>>2 /No journal file.*creating it/
# >>>=0
rm -f $$; bin/hledger balance --no-total -f $$; rm -f $$ rm -f $$; bin/hledger balance --no-total -f $$; rm -f $$
>>> >>>
>>>2 /No journal file.*creating it/ >>>2 /No journal file.*creating it/
>>>=0

View File

@ -10,3 +10,4 @@ bin/hledger -f - print
b (b) b -1 b (b) b -1
c -1 c -1
>>>=0

View File

@ -5,3 +5,4 @@ bin/hledger -f- print not:a
a 1 a 1
b -1 b -1
>>> >>>
>>>=0

View File

@ -13,3 +13,4 @@ bin/hledger -f - print desc:x
a 1 a 1
b -1 b -1
>>>=0

View File

@ -8,3 +8,4 @@ bin/hledger -f - print
aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1 aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1
b -1 b -1
>>>=0

View File

@ -11,3 +11,4 @@ bin/hledger -f - print
b -1 b -1
>>>2 >>>2
>>>=0

View File

@ -13,3 +13,4 @@ bin/hledger -f - print
a 1 ; amount comment a 1 ; amount comment
b -1 b -1
>>>=0

View File

@ -9,3 +9,4 @@ bin/hledger -f - register
2010/01/01 x a 1 1 2010/01/01 x a 1 1
b -1 0 b -1 0
>>>2 >>>2
>>>=0

View File

@ -6,3 +6,4 @@ bin/hledger -f data/sample.journal balance --depth 1
$1 liabilities $1 liabilities
-------------------- --------------------
0 0
>>>=0

View File

@ -6,3 +6,4 @@ bin/hledger -f data/sample.journal balance o
$-1 salary $-1 salary
-------------------- --------------------
$-1 $-1
>>>=0

View File

@ -12,3 +12,4 @@ bin/hledger -f data/sample.journal balance
$1 liabilities:debts $1 liabilities:debts
-------------------- --------------------
0 0
>>>=0

View File

@ -1,3 +1,4 @@
bin/hledger -f- stats bin/hledger -f- stats
<<< <<<
>>> /Accounts.* 0 \(depth 0\)/ >>> /Accounts.* 0 \(depth 0\)/
>>>=0

View File

@ -5,3 +5,4 @@ bin/hledger -f - register τράπ
नकद नकद
>>> >>>
2009/01/01 проверка τράπεζα 10 руб 10 руб 2009/01/01 проверка τράπεζα 10 руб 10 руб
>>>=0

View File

@ -8,3 +8,4 @@ bin/hledger -f - balance
-10 руб नकद -10 руб नकद
-------------------- --------------------
0 0
>>>=0

View File

@ -9,3 +9,4 @@ bin/hledger -f - register desc:аура
>>> >>>
2009/01/01 аура (cyrillic let.. bank 10 10 2009/01/01 аура (cyrillic let.. bank 10 10
cash -10 0 cash -10 0
>>>=0

View File

@ -8,3 +8,4 @@ bin/hledger -f - print
счёт:первый 1 счёт:первый 1
счёт:второй -1 счёт:второй -1
>>>=0

View File

@ -6,3 +6,4 @@ bin/hledger -f - register
>>> >>>
2009/01/01 проверка τράπεζα 10 руб 10 руб 2009/01/01 проверка τράπεζα 10 руб 10 руб
नकद -10 руб 0 नकद -10 руб 0
>>>=0

View File

@ -10,3 +10,4 @@ bin/hledger -f- print --empty
a 0 a 0
b 0 b 0
>>>=0