File: Stream.hs

package info (click to toggle)
haskell-zlib 0.6.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,300 kB
  • sloc: ansic: 7,058; haskell: 1,081; makefile: 6
file content (40 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (4)
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
33
34
35
36
37
38
39
40
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | Test code and properties for "Codec.Compression.Zlib.Stream"
--
module Test.Codec.Compression.Zlib.Stream where

import Codec.Compression.Zlib.Internal
import Test.QuickCheck


instance Arbitrary Format where
  -- GZipOrZlib omitted since it's not symmetric
  arbitrary = elements [gzipFormat, zlibFormat, rawFormat]


instance Arbitrary Method where
   arbitrary = return deflateMethod


instance Arbitrary CompressionLevel where
  arbitrary = elements $ [defaultCompression, noCompression,
                          bestCompression, bestSpeed]
                      ++ map compressionLevel [1..9]


instance Arbitrary WindowBits where
  arbitrary = elements $ defaultWindowBits:map windowBits [9..15]


instance Arbitrary MemoryLevel where
  arbitrary = elements $ [defaultMemoryLevel, minMemoryLevel, maxMemoryLevel]
                      ++ [memoryLevel n | n <- [1..9]]



instance Arbitrary CompressionStrategy where
  arbitrary = elements $ [defaultStrategy, filteredStrategy, huffmanOnlyStrategy]
                   -- These are disabled by default in the package
                   -- as they are only available with zlib >=1.2
                   -- ++ [RLE, Fixed]