1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Test code and properties for "Codec.Compression.Zlib.Internal"
--
module Test.Codec.Compression.Zlib.Internal where
import Codec.Compression.Zlib.Internal
import Test.Codec.Compression.Zlib.Stream ()
import Test.QuickCheck
import Control.Monad (ap)
instance Arbitrary CompressParams where
arbitrary = return CompressParams `ap` arbitrary `ap` arbitrary
`ap` arbitrary `ap` arbitrary
`ap` arbitrary `ap` arbitraryBufferSize
`ap` return Nothing
arbitraryBufferSize :: Gen Int
arbitraryBufferSize = frequency $ [(10, return n) | n <- [1..1024]] ++
[(20, return n) | n <- [1025..8192]] ++
[(40, return n) | n <- [8193..131072]] ++
[(1, return n) | n <- [131072..1048576]]
instance Arbitrary DecompressParams where
arbitrary = return DecompressParams `ap` arbitrary
`ap` arbitraryBufferSize
`ap` return Nothing
`ap` arbitrary
|