test cleanup
This commit is contained in:
parent
2b803b4558
commit
c8a03999b4
19
Tests.hs
19
Tests.hs
@ -259,9 +259,6 @@ tests = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
,"balanceEntry" ~: do
|
,"balanceEntry" ~: do
|
||||||
let fromeither (Left err) = error err
|
|
||||||
fromeither (Right e) = e
|
|
||||||
(tamount $ last $ etransactions $ fromeither $ balanceEntry entry1) `is` Mixed [dollars (-47.18)]
|
|
||||||
assertBool "detect unbalanced entry, sign error"
|
assertBool "detect unbalanced entry, sign error"
|
||||||
(isLeft $ balanceEntry
|
(isLeft $ balanceEntry
|
||||||
(Entry (parsedate "2007/01/28") False "" "test" ""
|
(Entry (parsedate "2007/01/28") False "" "test" ""
|
||||||
@ -274,12 +271,16 @@ tests = [
|
|||||||
[RawTransaction False "a" missingamt "" RegularTransaction,
|
[RawTransaction False "a" missingamt "" RegularTransaction,
|
||||||
RawTransaction False "b" missingamt "" RegularTransaction
|
RawTransaction False "b" missingamt "" RegularTransaction
|
||||||
] ""))
|
] ""))
|
||||||
assertBool "one missing amount should be ok"
|
let e = balanceEntry (Entry (parsedate "2007/01/28") False "" "test" ""
|
||||||
(isRight $ balanceEntry
|
[RawTransaction False "a" (Mixed [dollars 1]) "" RegularTransaction,
|
||||||
(Entry (parsedate "2007/01/28") False "" "test" ""
|
RawTransaction False "b" missingamt "" RegularTransaction
|
||||||
[RawTransaction False "a" (Mixed [dollars 1]) "" RegularTransaction,
|
] "")
|
||||||
RawTransaction False "b" missingamt "" RegularTransaction
|
assertBool "one missing amount should be ok" (isRight e)
|
||||||
] ""))
|
assertEqual "balancing amount is added"
|
||||||
|
(Mixed [dollars (-1)])
|
||||||
|
(case e of
|
||||||
|
Right e' -> (tamount $ last $ etransactions e')
|
||||||
|
Left _ -> error "should not happen")
|
||||||
|
|
||||||
,"balancereportacctnames" ~:
|
,"balancereportacctnames" ~:
|
||||||
let gives (opt,pats) e = do
|
let gives (opt,pats) e = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user