mirror of
https://github.com/mrdomino/hsnock.git
synced 2024-08-16 09:10:34 +03:00
Official, fancy tests
This commit is contained in:
parent
8953111ade
commit
a17eefc8a0
@ -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
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user