hunit, quickcheck
This commit is contained in:
parent
0a3cc44a0f
commit
d0cf8f8840
18
hledger.hs
18
hledger.hs
@ -99,7 +99,10 @@ i, o, b, h
|
|||||||
timelog files."
|
timelog files."
|
||||||
-}
|
-}
|
||||||
|
|
||||||
--import Debug.Trace
|
import Debug.Trace
|
||||||
|
import Test.QuickCheck
|
||||||
|
import Test.HUnit
|
||||||
|
|
||||||
--import TildeExpand -- confuses my ghc 6.7
|
--import TildeExpand -- confuses my ghc 6.7
|
||||||
import System.Directory (getHomeDirectory)
|
import System.Directory (getHomeDirectory)
|
||||||
import System.Environment (getEnv)
|
import System.Environment (getEnv)
|
||||||
@ -350,7 +353,18 @@ ledgereol = ledgercomment <|> do {newline; return []}
|
|||||||
|
|
||||||
spacenonewline = satisfy (\c -> c `elem` " \v\f\t")
|
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
|
test = do
|
||||||
parseTest ledgertransaction sample_transaction
|
parseTest ledgertransaction sample_transaction
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user