Skip to content

Commit

Permalink
prop_fromList_toList
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgidze committed Jun 19, 2012
1 parent c00452a commit d6208e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import Control.Monad
instance (Arbitrary a, Ord a) => Arbitrary (Set a) where
arbitrary = fmap fromList arbitrary

prop_fromList_toList :: Set Integer -> Bool
prop_fromList_toList x = fromList (toList x) == x

prop_monoid_law_1 :: Set Integer -> Bool
prop_monoid_law_1 x = mempty `mappend` x == x

Expand Down Expand Up @@ -76,6 +79,9 @@ prop_monad_plus_law_3 x y z = ((x `mplus` y) `mplus` z) == (x `mplus` (y `mplus`

main :: IO ()
main = do
putStrLn "prop_fromList_toList"
quickCheck prop_fromList_toList

putStrLn "prop_monoid_law_1:"
quickCheck prop_monoid_law_1
putStrLn "prop_monoid_law_2:"
Expand Down
8 changes: 1 addition & 7 deletions set-monad.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,4 @@ source-repository head
library
exposed-modules: Data.Set.Monad
build-depends: base >=4 && <5, deepseq, containers
ghc-options: -O3 -Wall

test-suite tests
main-is: Tests.hs
type: exitcode-stdio-1.0
build-depends: base >=4 && <5, deepseq, containers, QuickCheck
ghc-options: -O3 -Wall
ghc-options: -O3 -Wall

0 comments on commit d6208e2

Please sign in to comment.