From 8ff1abfb2a2030d2804c55b3e3b4456ab967bc4d Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 10 Dec 2008 18:37:25 +0000 Subject: [PATCH] failing test for eliding !account accounts --- Tests.hs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Tests.hs b/Tests.hs index e707ae324..353633f91 100644 --- a/Tests.hs +++ b/Tests.hs @@ -375,7 +375,7 @@ balancecommand_tests = TestList [ "") , "balance report with cost basis" ~: do - rawl <- rawledgerfromstring + rl <- rawledgerfromstring ("" ++ "2008/1/1 test \n" ++ " a:b 10h @ $50\n" ++ @@ -383,13 +383,28 @@ balancecommand_tests = TestList [ "\n") let l = cacheLedger [] $ filterRawLedger (DateSpan Nothing Nothing) [] False False $ - canonicaliseAmounts True rawl -- enable cost basis adjustment + canonicaliseAmounts True rl -- enable cost basis adjustment assertequal (" $500 a\n" ++ " $-500 c\n" ++ "" ) (showBalanceReport [] [] l) + , + "balance report with !account" ~: do + l <- ledgerfromstringwithopts [] [] refdate + ("!account TEST\n" ++ + "2008/1/1 test\n" ++ + " a 1\n" ++ + " b\n" + ) + assertequal "" (showBalanceReport [] [] l) + assertequal + (" 1 TEST:a\n" ++ + " -1 TEST:b\n" ++ + "" + ) + (showBalanceReport [SubTotal] [] l) ] where gives (opts,args) e = do l <- sampleledgerwithopts [] args