more test tweaks

This commit is contained in:
Simon Michael 2009-06-27 11:02:28 +00:00
parent 484580ca64
commit 3b9c6448be
14 changed files with 120 additions and 6 deletions

View File

@ -93,7 +93,7 @@ tools/doctest: tools/doctest.hs
# build the shell test runner
tools/shelltest: tools/shelltest.hs
ghc --make -threaded tools/shelltest.hs
ghc --make -threaded -O2 tools/shelltest.hs
# build the generateledger tool
tools/generateledger: tools/generateledger.hs
@ -103,16 +103,16 @@ tools/generateledger: tools/generateledger.hs
# TESTING
# quick code tests - run all the time
test: unittest doctest haddocktest
test: unittest doctest functest haddocktest
# moderate pre-commit tests
# run before recording or before send/pushing, your choice
committest: unittest doctest haddocktest warningstest
committest: unittest doctest functest haddocktest warningstest
@(cabal configure -fvty -fhapps \
&& echo $@ passed) || echo $@ FAILED
# thorough, pre-release tests - run before release
releasetest: unittest doctest haddocktest warningstest cabaltest
releasetest: unittest doctest functest haddocktest warningstest cabaltest
# run unit tests, without waiting for compilation
unittest:

View File

@ -165,11 +165,12 @@ $ printf "2009-01-01 x\n a 2\n b (b) b -1\n c\n" | hledger -f - print 2>&1;
Nafai's bug
@
$ printf "2009/1/1 x\n a: 13\n b\n" | hledger -f - bal -E 2>&1; true
"-" (line 2, column 1):
hledger: parse error at (line 1, column 4):
unexpected " "
accountname seems ill-formed: a:
@
Eliding, general layout
@
$ printf "2009/1/1 x\n aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa €1\n b\n" | hledger -f - bal 2>&1
@ -189,7 +190,6 @@ $ printf "2009/1/1 x\n aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa
aa:aaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa
b
@
-}
-- other test tools:
-- http://hackage.haskell.org/cgi-bin/hackage-scripts/package/test-framework

View File

@ -0,0 +1,8 @@
balance
<<<
2009/1/1 x
aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa €1
b
>>>
€1 aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa
€-1 b

View File

@ -0,0 +1,9 @@
print
<<<
2009/1/1 x
aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa €1
b
>>>
2009/01/01 x
aa:aaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa
b

View File

@ -0,0 +1,7 @@
register
<<<
2009/1/1 x aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa:aaaaaaaaaaaaaaaaaaaa €1
b
>>>
2009/01/01 x aa:aa:aaaaaaaaaaaaaaaa €1 €1
b €-1 0

View File

@ -0,0 +1,10 @@
balance -E
<<<
2009/1/1 x
a: 13
b
>>>2
hledger: parse error at (line 1, column 4):
unexpected " "
accountname seems ill-formed: a:
===1

View File

@ -0,0 +1,12 @@
print
<<<
2009-01-01 x
a 2
b (b) b -1
c
>>>
2009/01/01 x
a 2
b (b) b -1
c

View File

@ -0,0 +1,7 @@
register τράπ
<<<
2009-01-01 проверка
τράπεζα 10 руб
नकद
>>>
2009/01/01 проверка τράπεζα 10 руб 10 руб

View File

@ -0,0 +1,8 @@
balance
<<<
2009-01-01 проверка
τράπεζα 10 руб
नकद
>>>
10 руб τράπεζα
-10 руб नकद

View File

@ -0,0 +1,11 @@
register desc:аура
<<<
2009-01-01 аура (cyrillic letters)
bank 10
cash
2010-01-01 aypa (roman letters)
bank 20
cash
>>>
2009/01/01 аура (cyrillic let.. bank 10 10
cash -10 0

View File

@ -0,0 +1,12 @@
; not implemented yet
balance >/dev/null
<<<
2009-01-01 broken entry
дебит 1
кредит -2
>>>2
hledger: could not balance this transaction, amounts do not add up to zero:
2009/01/01 broken entry
дебит 1
кредит -2

10
tests/unicode-print.test Normal file
View File

@ -0,0 +1,10 @@
print
<<<
2009-01-01 проверка
счёт:первый 1
счёт:второй
>>>
2009/01/01 проверка
счёт:первый 1
счёт:второй

View File

@ -0,0 +1,8 @@
register
<<<
2009-01-01 проверка
τράπεζα 10 руб
नकद
>>>
2009/01/01 проверка τράπεζα 10 руб 10 руб
नकद -10 руб 0

12
tests/virtual.test Normal file
View File

@ -0,0 +1,12 @@
print
<<<
2009/1/1 x
(virtual) 100
a 1
b
>>>
2009/01/01 x
(virtual) 100
a 1
b