@@ -11,14 +11,10 @@ import Data.Foldable (foldl)
1111import Test.QuickCheck
1212
1313import qualified Data.Map as M
14- import qualified Data.Set as S
1514
1615instance arbMap :: (Eq k , Ord k , Arbitrary k , Arbitrary v ) => Arbitrary (M.Map k v ) where
1716 arbitrary = M .fromList <$> arbitrary
1817
19- instance arbSet :: (Eq a , Ord a , Arbitrary a ) => Arbitrary (S.Set a ) where
20- arbitrary = S .fromList <$> arbitrary
21-
2218data SmallKey = A | B | C | D | E | F | G | H | I | J
2319
2420instance showSmallKey :: Show SmallKey where
@@ -169,35 +165,3 @@ mapTests = do
169165
170166 trace " Union is idempotent"
171167 quickCheck $ \m1 m2 -> (m1 `M.union` m2) == ((m1 `M.union` m2) `M.union` (m2 :: M.Map SmallKey Number ))
172-
173- -- Data.Set
174-
175- trace " testMemberEmpty: member _ empty == false"
176- quickCheck $ \a -> S .member a (S .empty :: S.Set SmallKey ) == false
177-
178- trace " testMemberSingleton: member a (singleton a) == true"
179- quickCheck $ \a -> S .member (a :: SmallKey ) (S .singleton a) == true
180-
181- trace " testInsertDelete: member a (delete a (insert a empty) == false)"
182- quickCheck $ \a -> (S .member (a :: SmallKey ) $
183- S .delete a $
184- S .insert a S .empty) == false
185-
186- trace " testSingletonToList: toList (singleton a) == [a]"
187- quickCheck $ \a -> S .toList (S .singleton a :: S.Set SmallKey ) == [a]
188-
189- trace " testToListFromList: toList . fromList = id"
190- quickCheck $ \arr -> let f x = S .toList (S .fromList x) in
191- f (f arr) == f (arr :: [SmallKey ])
192-
193- trace " testFromListToList: fromList . toList = id"
194- quickCheck $ \s -> let f s = S .fromList (S .toList s) in
195- S .toList (f s) == S .toList (s :: S.Set SmallKey )
196-
197- trace " testUnionSymmetric: union s1 s2 == union s2 s1"
198- quickCheck $ \s1 s2 -> let s3 = s1 `S.union` (s2 :: S.Set SmallKey ) in
199- let s4 = s2 `S.union` s1 in
200- S .toList s3 == S .toList s4
201-
202- trace " testUnionIdempotent"
203- quickCheck $ \s1 s2 -> (s1 `S.union` s2) == ((s1 `S.union` s2) `S.union` (s2 :: S.Set SmallKey ))
0 commit comments