Skip to content

Commit 7d89135

Browse files
author
Johannes Waldmann
committed
use library implementation of Large
1 parent 259b737 commit 7d89135

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

containers-tests/tests/intset-properties.hs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ main = defaultMain [ testCase "lookupLT" test_lookupLT
2626
, testProperty "prop_SingletonValid" prop_SingletonValid
2727
, testProperty "prop_InsertIntoEmptyValid" prop_InsertIntoEmptyValid
2828
, testProperty "prop_instanceEqIntSet" prop_instanceEqIntSet
29-
, testProperty "prop_instanceEqIntSet'" prop_instanceEqIntSet'
3029
, testProperty "prop_instanceOrdIntSet" prop_instanceOrdIntSet
31-
, testProperty "prop_instanceOrdIntSet'" prop_instanceOrdIntSet'
3230
, testProperty "prop_Single" prop_Single
3331
, testProperty "prop_Member" prop_Member
3432
, testProperty "prop_NotMember" prop_NotMember
@@ -113,18 +111,9 @@ test_split = do
113111
--------------------------------------------------------------------}
114112
instance Arbitrary IntSet where
115113
arbitrary = do{ xs <- arbitrary
116-
; return (fromList xs)
114+
; return (fromList (fmap getLarge xs))
117115
}
118116

119-
newtype LargeInt = LargeInt { unLargeInt :: Int }
120-
121-
instance Arbitrary LargeInt where
122-
arbitrary = ( \ (x,y) -> LargeInt $ if x == 0 then y else signum x * (2 ^ abs x) * y) <$> arbitrary
123-
124-
newtype LargeIntSet = LargeIntSet IntSet deriving Show
125-
instance Arbitrary LargeIntSet where
126-
arbitrary = (LargeIntSet . fromList . fmap unLargeInt) <$> arbitrary
127-
128117
{--------------------------------------------------------------------
129118
Valid IntMaps
130119
--------------------------------------------------------------------}
@@ -164,15 +153,9 @@ prop_InsertIntoEmptyValid x =
164153
prop_instanceEqIntSet :: IntSet -> IntSet -> Bool
165154
prop_instanceEqIntSet x y = (x == y) == (toAscList x == toAscList y)
166155

167-
prop_instanceEqIntSet' :: LargeIntSet -> LargeIntSet -> Bool
168-
prop_instanceEqIntSet' (LargeIntSet x) (LargeIntSet y) = (x == y) == (toAscList x == toAscList y)
169-
170156
prop_instanceOrdIntSet :: IntSet -> IntSet -> Bool
171157
prop_instanceOrdIntSet x y = (compare x y) == (compare (toAscList x) (toAscList y))
172158

173-
prop_instanceOrdIntSet' :: LargeIntSet -> LargeIntSet -> Bool
174-
prop_instanceOrdIntSet' (LargeIntSet x) (LargeIntSet y) = (compare x y) == (compare (toAscList x) (toAscList y))
175-
176159
{--------------------------------------------------------------------
177160
Single, Member, Insert, Delete, Member, FromList
178161
--------------------------------------------------------------------}

0 commit comments

Comments
 (0)