add a register command test

This commit is contained in:
Simon Michael 2008-10-15 21:10:36 +00:00
parent 5f1bec0b60
commit a56da854b3

View File

@ -77,6 +77,7 @@ unittests = TestList [
functests = TestList [ functests = TestList [
balancecommandtests balancecommandtests
,registercommandtests
] ]
balancecommandtests = TestList [ balancecommandtests = TestList [
@ -179,6 +180,13 @@ balancecommandtests = TestList [
assertequal "" $ showBalanceReport [] ["-e"] l assertequal "" $ showBalanceReport [] ["-e"] l
] ]
registercommandtests = TestList [
"register does something" ~:
do
l <- ledgerfromfile "sample.ledger"
assertnotequal "" $ showTransactionsWithBalances [] [] l
]
-- | Assert a parsed thing equals some expected thing, or print a parse error. -- | Assert a parsed thing equals some expected thing, or print a parse error.
assertparseequal :: (Show a, Eq a) => a -> (Either ParseError a) -> Assertion assertparseequal :: (Show a, Eq a) => a -> (Either ParseError a) -> Assertion
assertparseequal expected parsed = either printParseError (assertequal expected) parsed assertparseequal expected parsed = either printParseError (assertequal expected) parsed