Skip to content

Commit e137065

Browse files
committed
Support QuickCheck-2.17
1 parent 227bb90 commit e137065

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/Tests/QuickCheckUtils.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ import Data.Char (isSpace)
3939
import Data.IORef (writeIORef)
4040
import Data.Text.Foreign (I8)
4141
import Data.Text.Lazy.Builder.RealFloat (FPFormat(..))
42-
import Data.Word (Word8, Word16)
42+
import Data.Word (Word8)
43+
#if !MIN_VERSION_QuickCheck(2,17,0)
44+
import Data.Word (Word16)
45+
#endif
4346
import qualified GHC.IO.Buffer as GIO
4447
import qualified GHC.IO.Handle.Internals as GIO
4548
import qualified GHC.IO.Handle.Types as GIO
@@ -61,9 +64,6 @@ import qualified System.IO as IO
6164
genWord8 :: Gen Word8
6265
genWord8 = chooseAny
6366

64-
genWord16 :: Gen Word16
65-
genWord16 = chooseAny
66-
6767
instance Arbitrary I8 where
6868
arbitrary = arbitrarySizedIntegral
6969
shrink = shrinkIntegral
@@ -232,13 +232,18 @@ instance Arbitrary IO.NewlineMode where
232232
arbitrary = IO.NewlineMode <$> arbitrary <*> arbitrary
233233
#endif
234234

235+
#if !MIN_VERSION_QuickCheck(2,17,0)
235236
instance Arbitrary IO.BufferMode where
236237
arbitrary = oneof [ return IO.NoBuffering,
237238
return IO.LineBuffering,
238239
return (IO.BlockBuffering Nothing),
239240
(IO.BlockBuffering . Just . (+1) . fromIntegral) `fmap`
240241
genWord16 ]
241242

243+
genWord16 :: Gen Word16
244+
genWord16 = chooseAny
245+
#endif
246+
242247
-- This test harness is complex! What property are we checking?
243248
--
244249
-- Reading after writing a multi-line file should give the same

text.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ test-suite tests
294294
Tests.Utils
295295

296296
build-depends:
297-
QuickCheck >= 2.12.6 && < 2.17,
297+
QuickCheck >= 2.12.6 && < 2.18,
298298
base <5,
299299
binary,
300300
bytestring,

0 commit comments

Comments
 (0)