fix all recently-broken tests
This commit is contained in:
parent
cb89dd2b94
commit
53b7962658
40
Tests.hs
40
Tests.hs
@ -668,9 +668,9 @@ tests = [
|
|||||||
l <- sampleledgerwithopts [] args
|
l <- sampleledgerwithopts [] args
|
||||||
showLedgerTransactions [] args l `is` unlines
|
showLedgerTransactions [] args l `is` unlines
|
||||||
["2008/06/03 * eat & shop"
|
["2008/06/03 * eat & shop"
|
||||||
," expenses:food $1"
|
," expenses:food $1"
|
||||||
," expenses:supplies $1"
|
," expenses:supplies $1"
|
||||||
," assets:cash"
|
," assets:cash $-2"
|
||||||
,""
|
,""
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -679,18 +679,18 @@ tests = [
|
|||||||
l <- sampleledger
|
l <- sampleledger
|
||||||
showLedgerTransactions [Depth "2"] [] l `is` unlines
|
showLedgerTransactions [Depth "2"] [] l `is` unlines
|
||||||
["2008/01/01 income"
|
["2008/01/01 income"
|
||||||
," income:salary $-1"
|
," income:salary $-1"
|
||||||
,""
|
,""
|
||||||
,"2008/06/01 gift"
|
,"2008/06/01 gift"
|
||||||
," income:gifts $-1"
|
," income:gifts $-1"
|
||||||
,""
|
,""
|
||||||
,"2008/06/03 * eat & shop"
|
,"2008/06/03 * eat & shop"
|
||||||
," expenses:food $1"
|
," expenses:food $1"
|
||||||
," expenses:supplies $1"
|
," expenses:supplies $1"
|
||||||
," assets:cash"
|
," assets:cash $-2"
|
||||||
,""
|
,""
|
||||||
,"2008/12/31 * pay off"
|
,"2008/12/31 * pay off"
|
||||||
," liabilities:debts $1"
|
," liabilities:debts $1"
|
||||||
,""
|
,""
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ tests = [
|
|||||||
assertEqual "show a balanced transaction, eliding last amount"
|
assertEqual "show a balanced transaction, eliding last amount"
|
||||||
(unlines
|
(unlines
|
||||||
["2007/01/28 coopportunity"
|
["2007/01/28 coopportunity"
|
||||||
," expenses:food:groceries $47.18"
|
," expenses:food:groceries $47.18"
|
||||||
," assets:checking"
|
," assets:checking"
|
||||||
,""
|
,""
|
||||||
])
|
])
|
||||||
@ -841,12 +841,24 @@ tests = [
|
|||||||
[Posting False "expenses:food:groceries" (Mixed [dollars 47.18]) "" RegularPosting
|
[Posting False "expenses:food:groceries" (Mixed [dollars 47.18]) "" RegularPosting
|
||||||
,Posting False "assets:checking" (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:
|
-- document some cases that arise in debug/testing:
|
||||||
assertEqual "show an unbalanced transaction, should not elide"
|
assertEqual "show an unbalanced transaction, should not elide"
|
||||||
(unlines
|
(unlines
|
||||||
["2007/01/28 coopportunity"
|
["2007/01/28 coopportunity"
|
||||||
," expenses:food:groceries $47.18"
|
," expenses:food:groceries $47.18"
|
||||||
," assets:checking $-47.19"
|
," assets:checking $-47.19"
|
||||||
,""
|
,""
|
||||||
])
|
])
|
||||||
(showLedgerTransaction
|
(showLedgerTransaction
|
||||||
@ -857,7 +869,7 @@ tests = [
|
|||||||
assertEqual "show an unbalanced transaction with one posting, should not elide"
|
assertEqual "show an unbalanced transaction with one posting, should not elide"
|
||||||
(unlines
|
(unlines
|
||||||
["2007/01/28 coopportunity"
|
["2007/01/28 coopportunity"
|
||||||
," expenses:food:groceries $47.18"
|
," expenses:food:groceries $47.18"
|
||||||
,""
|
,""
|
||||||
])
|
])
|
||||||
(showLedgerTransaction
|
(showLedgerTransaction
|
||||||
@ -867,7 +879,7 @@ tests = [
|
|||||||
assertEqual "show a transaction with one posting and a missing amount"
|
assertEqual "show a transaction with one posting and a missing amount"
|
||||||
(unlines
|
(unlines
|
||||||
["2007/01/28 coopportunity"
|
["2007/01/28 coopportunity"
|
||||||
," expenses:food:groceries "
|
," expenses:food:groceries "
|
||||||
,""
|
,""
|
||||||
])
|
])
|
||||||
(showLedgerTransaction
|
(showLedgerTransaction
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
(d)
|
(d)
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 x
|
2009/01/01 x
|
||||||
a 1
|
a 1
|
||||||
b -1
|
b -1
|
||||||
(c)
|
(c)
|
||||||
(d)
|
(d)
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,6 @@
|
|||||||
; comment line after postings
|
; comment line after postings
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 x
|
2009/01/01 x
|
||||||
a 1
|
a 1
|
||||||
b
|
b -1
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,6 @@
|
|||||||
b
|
b
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 x
|
2009/01/01 x
|
||||||
a 1
|
a 1
|
||||||
b
|
b -1
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,6 @@
|
|||||||
b
|
b
|
||||||
>>>
|
>>>
|
||||||
2010/01/01 x
|
2010/01/01 x
|
||||||
a 1
|
a 1
|
||||||
b
|
b -1
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
c
|
c
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 x
|
2009/01/01 x
|
||||||
a 2
|
a 2
|
||||||
b (b) b -1
|
b (b) b -1
|
||||||
c
|
c -1
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
2009/01/01 x ; description comment
|
2009/01/01 x ; description comment
|
||||||
a 1 ; amount comment
|
a 1 ; amount comment
|
||||||
; middle posting comment
|
; middle posting comment
|
||||||
b
|
b -1
|
||||||
; trailing posting comment
|
; trailing posting comment
|
||||||
; post-entry comment (?)
|
; post-entry comment (?)
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,6 @@
|
|||||||
unexpected end of input
|
unexpected end of input
|
||||||
could not balance this transaction, amounts do not add up to zero:
|
could not balance this transaction, amounts do not add up to zero:
|
||||||
2009/01/01 broken entry
|
2009/01/01 broken entry
|
||||||
дебит 1
|
дебит 1
|
||||||
кредит -2
|
кредит -2
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,6 @@
|
|||||||
счёт:второй
|
счёт:второй
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 проверка
|
2009/01/01 проверка
|
||||||
счёт:первый 1
|
счёт:первый 1
|
||||||
счёт:второй
|
счёт:второй -1
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
b
|
b
|
||||||
>>>
|
>>>
|
||||||
2009/01/01 x
|
2009/01/01 x
|
||||||
(virtual) 100
|
(virtual) 100
|
||||||
a 1
|
a 1
|
||||||
b
|
b -1
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user