fix all recently-broken tests

This commit is contained in:
Simon Michael 2009-11-25 12:21:59 +00:00
parent cb89dd2b94
commit 53b7962658
10 changed files with 47 additions and 35 deletions

View File

@ -668,9 +668,9 @@ tests = [
l <- sampleledgerwithopts [] args
showLedgerTransactions [] args l `is` unlines
["2008/06/03 * eat & shop"
," expenses:food $1"
," expenses:supplies $1"
," assets:cash"
," expenses:food $1"
," expenses:supplies $1"
," assets:cash $-2"
,""
]
@ -679,18 +679,18 @@ tests = [
l <- sampleledger
showLedgerTransactions [Depth "2"] [] l `is` unlines
["2008/01/01 income"
," income:salary $-1"
," income:salary $-1"
,""
,"2008/06/01 gift"
," income:gifts $-1"
," income:gifts $-1"
,""
,"2008/06/03 * eat & shop"
," expenses:food $1"
," expenses:supplies $1"
," assets:cash"
," expenses:food $1"
," expenses:supplies $1"
," assets:cash $-2"
,""
,"2008/12/31 * pay off"
," liabilities:debts $1"
," liabilities:debts $1"
,""
]
@ -832,7 +832,7 @@ tests = [
assertEqual "show a balanced transaction, eliding last amount"
(unlines
["2007/01/28 coopportunity"
," expenses:food:groceries $47.18"
," expenses:food:groceries $47.18"
," assets:checking"
,""
])
@ -841,12 +841,24 @@ tests = [
[Posting False "expenses:food:groceries" (Mixed [dollars 47.18]) "" RegularPosting
,Posting False "assets:checking" (Mixed [dollars (-47.18)]) "" RegularPosting
] ""))
assertEqual "show a balanced transaction, no eliding"
(unlines
["2007/01/28 coopportunity"
," expenses:food:groceries $47.18"
," assets:checking $-47.18"
,""
])
(showLedgerTransactionUnelided
(LedgerTransaction (parsedate "2007/01/28") Nothing False "" "coopportunity" ""
[Posting False "expenses:food:groceries" (Mixed [dollars 47.18]) "" RegularPosting
,Posting False "assets:checking" (Mixed [dollars (-47.18)]) "" RegularPosting
] ""))
-- document some cases that arise in debug/testing:
assertEqual "show an unbalanced transaction, should not elide"
(unlines
["2007/01/28 coopportunity"
," expenses:food:groceries $47.18"
," assets:checking $-47.19"
," expenses:food:groceries $47.18"
," assets:checking $-47.19"
,""
])
(showLedgerTransaction
@ -857,7 +869,7 @@ tests = [
assertEqual "show an unbalanced transaction with one posting, should not elide"
(unlines
["2007/01/28 coopportunity"
," expenses:food:groceries $47.18"
," expenses:food:groceries $47.18"
,""
])
(showLedgerTransaction
@ -867,7 +879,7 @@ tests = [
assertEqual "show a transaction with one posting and a missing amount"
(unlines
["2007/01/28 coopportunity"
," expenses:food:groceries "
," expenses:food:groceries "
,""
])
(showLedgerTransaction

View File

@ -7,8 +7,8 @@
(d)
>>>
2009/01/01 x
a 1
b -1
(c)
(d)
a 1
b -1
(c)
(d)

View File

@ -6,6 +6,6 @@
; comment line after postings
>>>
2009/01/01 x
a 1
b
a 1
b -1

View File

@ -6,6 +6,6 @@
b
>>>
2009/01/01 x
a 1
b
a 1
b -1

View File

@ -5,6 +5,6 @@
b
>>>
2010/01/01 x
a 1
b
a 1
b -1

View File

@ -6,7 +6,7 @@
c
>>>
2009/01/01 x
a 2
b (b) b -1
c
a 2
b (b) b -1
c -1

View File

@ -11,7 +11,7 @@
2009/01/01 x ; description comment
a 1 ; amount comment
; middle posting comment
b
b -1
; trailing posting comment
; post-entry comment (?)

View File

@ -8,6 +8,6 @@
unexpected end of input
could not balance this transaction, amounts do not add up to zero:
2009/01/01 broken entry
дебит 1
кредит -2
дебит 1
кредит -2

View File

@ -5,6 +5,6 @@
счёт:второй
>>>
2009/01/01 проверка
счёт:первый 1
счёт:второй
счёт:первый 1
счёт:второй -1

View File

@ -6,7 +6,7 @@
b
>>>
2009/01/01 x
(virtual) 100
a 1
b
(virtual) 100
a 1
b -1