on master help sign in
Remove dead code, courtesy of QuickCheck 2.3
d904602Bryan O'Sullivan
tests/Properties.hs+2−5
@@ -93,9 +93,6 @@ data DecodeErr = DE String OnDecodeError
93instance Show DecodeErr where
93instance Show DecodeErr where
94 show (DE d _) = "DE " ++ d
94 show (DE d _) = "DE " ++ d
95
95
96−instance CoArbitrary Word8 where
97− coarbitrary = coarbitraryIntegral
98−
99instance Arbitrary DecodeErr where
96instance Arbitrary DecodeErr where
100 arbitrary = oneof [ return $ DE "lenient" lenientDecode
97 arbitrary = oneof [ return $ DE "lenient" lenientDecode
101 , return $ DE "ignore" ignore
98 , return $ DE "ignore" ignore
@@ -682,13 +679,13 @@ isFloaty c = c `elem` "+-.0123456789eE"
682
679
683t_read_rational p tol (n::Double) s =
680t_read_rational p tol (n::Double) s =
684 case p (T.pack (show n) `T.append` t) of
681 case p (T.pack (show n) `T.append` t) of
685− Left err -> False
682+ Left _err -> False
686 Right (n',t') -> t == t' && abs (n-n') <= tol
683 Right (n',t') -> t == t' && abs (n-n') <= tol
687 where t = T.dropWhile isFloaty s
684 where t = T.dropWhile isFloaty s
688
685
689tl_read_rational p tol (n::Double) s =
686tl_read_rational p tol (n::Double) s =
690 case p (TL.pack (show n) `TL.append` t) of
687 case p (TL.pack (show n) `TL.append` t) of
691− Left err -> False
688+ Left _err -> False
692 Right (n',t') -> t == t' && abs (n-n') <= tol
689 Right (n',t') -> t == t' && abs (n-n') <= tol
693 where t = TL.dropWhile isFloaty s
690 where t = TL.dropWhile isFloaty s
694
691
tests/QuickCheckUtils.hs−30
@@ -5,8 +5,6 @@ module QuickCheckUtils where
5import Control.Arrow (first)
5import Control.Arrow (first)
6import Data.Char (chr)
6import Data.Char (chr)
7import Data.Bits ((.&.))
7import Data.Bits ((.&.))
8−import Data.Int (Int64)
9−import Data.Word (Word8, Word16, Word32)
10import Data.String (IsString, fromString)
8import Data.String (IsString, fromString)
11import qualified Data.Text as T
9import qualified Data.Text as T
12import Data.Text.Foreign (I16)
10import Data.Text.Foreign (I16)
@@ -15,13 +13,6 @@ import System.Random (Random(..), RandomGen)
15import Test.QuickCheck hiding ((.&.))
13import Test.QuickCheck hiding ((.&.))
16import qualified Data.ByteString as B
14import qualified Data.ByteString as B
17
15
18−instance Random Int64 where
19− randomR = integralRandomR
20− random = randomR (minBound,maxBound)
21−
22−instance Arbitrary Int64 where
23− arbitrary = choose (minBound,maxBound)
24−
25instance Random I16 where
16instance Random I16 where
26 randomR = integralRandomR
17 randomR = integralRandomR
27 random = randomR (minBound,maxBound)
18 random = randomR (minBound,maxBound)
@@ -29,30 +20,9 @@ instance Random I16 where
29instance Arbitrary I16 where
20instance Arbitrary I16 where
30 arbitrary = choose (minBound,maxBound)
21 arbitrary = choose (minBound,maxBound)
31
22
32−instance Random Word8 where
33− randomR = integralRandomR
34− random = randomR (minBound,maxBound)
35−
36−instance Arbitrary Word8 where
37− arbitrary = choose (minBound,maxBound)
38−
39instance Arbitrary B.ByteString where
23instance Arbitrary B.ByteString where
40 arbitrary = B.pack `fmap` arbitrary
24 arbitrary = B.pack `fmap` arbitrary
41
25
42−instance Random Word16 where
43− randomR = integralRandomR
44− random = randomR (minBound,maxBound)
45−
46−instance Arbitrary Word16 where
47− arbitrary = choose (minBound,maxBound)
48−
49−instance Random Word32 where
50− randomR = integralRandomR
51− random = randomR (minBound,maxBound)
52−
53−instance Arbitrary Word32 where
54− arbitrary = choose (minBound,maxBound)
55−
56genUnicode :: IsString a => Gen a
26genUnicode :: IsString a => Gen a
57genUnicode = fmap fromString string where
27genUnicode = fmap fromString string where
58 string = sized $ \n ->
28 string = sized $ \n ->