From d0cf8f8840b0191a3c0f10bafe40143ec41fbb42 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 30 Jan 2007 08:16:07 +0000 Subject: [PATCH] hunit, quickcheck --- hledger.hs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hledger.hs b/hledger.hs index 433c62857..c27b288d5 100644 --- a/hledger.hs +++ b/hledger.hs @@ -99,7 +99,10 @@ i, o, b, h timelog files." -} ---import Debug.Trace +import Debug.Trace +import Test.QuickCheck +import Test.HUnit + --import TildeExpand -- confuses my ghc 6.7 import System.Directory (getHomeDirectory) import System.Environment (getEnv) @@ -350,7 +353,18 @@ ledgereol = ledgercomment <|> do {newline; return []} spacenonewline = satisfy (\c -> c `elem` " \v\f\t") --- utils +-- tests + +test1 = TestCase (assertEqual "1==1" 1 1) +sometests = TestList [TestLabel "test1" test1] + +tests = Test.HUnit.test [ + "test1" ~: "1==1" ~: 1 ~=? 1, + "test2" ~: assertEqual "2==2" 2 2 + ] + +prop_test1 = 1 == 1 +prop2 = 1 == 1 test = do parseTest ledgertransaction sample_transaction