Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove dead code, courtesy of QuickCheck 2.3

  • Loading branch information...
commit d90460220d82e8e142f41dcaaab14978bfb70479 1 parent a0f0523
Bryan O'Sullivan authored

Showing 2 changed files with 2 additions and 35 deletions. Show diff stats Hide diff stats

  1. +2 5 tests/Properties.hs
  2. +0 30 tests/QuickCheckUtils.hs
7 tests/Properties.hs
@@ -93,9 +93,6 @@ data DecodeErr = DE String OnDecodeError
93 93 instance Show DecodeErr where
94 94 show (DE d _) = "DE " ++ d
95 95
96   -instance CoArbitrary Word8 where
97   - coarbitrary = coarbitraryIntegral
98   -
99 96 instance Arbitrary DecodeErr where
100 97 arbitrary = oneof [ return $ DE "lenient" lenientDecode
101 98 , return $ DE "ignore" ignore
@@ -682,13 +679,13 @@ isFloaty c = c `elem` "+-.0123456789eE"
682 679
683 680 t_read_rational p tol (n::Double) s =
684 681 case p (T.pack (show n) `T.append` t) of
685   - Left err -> False
  682 + Left _err -> False
686 683 Right (n',t') -> t == t' && abs (n-n') <= tol
687 684 where t = T.dropWhile isFloaty s
688 685
689 686 tl_read_rational p tol (n::Double) s =
690 687 case p (TL.pack (show n) `TL.append` t) of
691   - Left err -> False
  688 + Left _err -> False
692 689 Right (n',t') -> t == t' && abs (n-n') <= tol
693 690 where t = TL.dropWhile isFloaty s
694 691
30 tests/QuickCheckUtils.hs
@@ -5,8 +5,6 @@ module QuickCheckUtils where
5 5 import Control.Arrow (first)
6 6 import Data.Char (chr)
7 7 import Data.Bits ((.&.))
8   -import Data.Int (Int64)
9   -import Data.Word (Word8, Word16, Word32)
10 8 import Data.String (IsString, fromString)
11 9 import qualified Data.Text as T
12 10 import Data.Text.Foreign (I16)
@@ -15,13 +13,6 @@ import System.Random (Random(..), RandomGen)
15 13 import Test.QuickCheck hiding ((.&.))
16 14 import 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   -
25 16 instance Random I16 where
26 17 randomR = integralRandomR
27 18 random = randomR (minBound,maxBound)
@@ -29,30 +20,9 @@ instance Random I16 where
29 20 instance Arbitrary I16 where
30 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   -
39 23 instance Arbitrary B.ByteString where
40 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   -
56 26 genUnicode :: IsString a => Gen a
57 27 genUnicode = fmap fromString string where
58 28 string = sized $ \n ->

0 comments on commit d904602

Please sign in to comment.
Something went wrong with that request. Please try again.