Official, fancy tests

This commit is contained in:
Steven Dee 2013-10-20 20:41:51 -04:00
parent 8953111ade
commit a17eefc8a0
2 changed files with 9 additions and 4 deletions

View File

@ -7,6 +7,11 @@ category: Language
build-type: Simple
cabal-version: >=1.8
test-suite test
type: exitcode-stdio-1.0
main-is: test.hs
build-depends: base >=4.5, parsec >=3.1, QuickCheck >=2.6
executable hsnock
main-is: nock.hs
build-depends: base >=4.5, parsec >=3.1, readline >=1.0

View File

@ -10,10 +10,10 @@ main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
instance Arbitrary Noun where
arbitrary = do coin <- arbitrary
if coin
then liftM (Atom . abs) arbitrary
else do a <- arbitrary
b <- arbitrary
return $ a :- b
then liftM (Atom . abs) arbitrary
else do a <- arbitrary
b <- arbitrary
return $ a :- b
prop_parse_show n = n == ps n
where ps n = case parse noun "" (show n) of