zlib-bindings 0.1.1.1 → 0.1.1.2
raw patch · 3 files changed
+11/−13 lines, 3 filesdep −HUnitdep ~hspecbinary-added
Dependencies removed: HUnit
Dependency ranges changed: hspec
Files
- LICENSE.gz binary
- test/main.hs +7/−9
- zlib-bindings.cabal +4/−4
+ LICENSE.gz view
binary file changed (absent → 741 bytes)
test/main.hs view
@@ -1,11 +1,9 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} -import Test.Hspec.Monadic-import Test.Hspec.HUnit ()+import Test.Hspec import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Arbitrary (..))-import Test.HUnit import Codec.Zlib import Codec.Compression.Zlib@@ -84,7 +82,7 @@ Just z -> go (front . (:) z) x main :: IO ()-main = hspecX $ do+main = hspec $ do describe "inflate/deflate" $ do prop "decompress'" $ \lbs -> lbs == decompress' (compress lbs) prop "compress'" $ \lbs -> lbs == decompress (compress' lbs)@@ -96,7 +94,7 @@ raw <- L.readFile "LICENSE" deflated <- return $ deflateWithDict exampleDict raw inflated <- return $ inflateWithDict (S.drop 1 exampleDict) deflated- assertBool "is null" $ L.null inflated+ inflated `shouldSatisfy` L.null describe "license" $ do it "single deflate" $ do@@ -109,7 +107,7 @@ gziped <- feedDeflate def license >>= go id gziped' <- go gziped $ finishDeflate def let raw' = L.fromChunks [license]- raw' @?= Gzip.decompress (L.fromChunks $ gziped' [])+ raw' `shouldBe` Gzip.decompress (L.fromChunks $ gziped' []) it "single inflate" $ do let go front x = do@@ -122,7 +120,7 @@ popper <- feedInflate inf gziped ungziped <- go id popper final <- finishInflate inf- license @?= (S.concat $ ungziped [final])+ license `shouldBe` (S.concat $ ungziped [final]) it "multi deflate" $ do let go' inf front bs = feedDeflate inf bs >>= go front@@ -135,7 +133,7 @@ gziped <- foldM (go' def) id $ map S.singleton $ S.unpack license gziped' <- go gziped $ finishDeflate def let raw' = L.fromChunks [license]- raw' @?= (Gzip.decompress $ L.fromChunks $ gziped' [])+ raw' `shouldBe` (Gzip.decompress $ L.fromChunks $ gziped' []) it "multi inflate" $ do let go' inf front bs = feedInflate inf bs >>= go front@@ -149,7 +147,7 @@ inf <- initInflate $ WindowBits 31 ungziped' <- foldM (go' inf) id gziped' final <- finishInflate inf- license @?= (S.concat $ ungziped' [final])+ license `shouldBe` (S.concat $ ungziped' [final]) describe "lbs zlib" $ do prop "inflate" $ \lbs -> unsafePerformIO $ do
zlib-bindings.cabal view
@@ -1,5 +1,5 @@ name: zlib-bindings-version: 0.1.1.1+version: 0.1.1.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -13,7 +13,8 @@ homepage: http://github.com/snoyberg/zlib-bindings extra-source-files: cbits/crc32.h cbits/inffast.h cbits/inflate.h cbits/trees.h cbits/deflate.h cbits/inffixed.h- cbits/inftrees.h cbits/zutil.h, test/main.hs+ cbits/inftrees.h cbits/zutil.h, test/main.hs,+ LICENSE.gz library build-depends: base >= 4 && < 5@@ -35,9 +36,8 @@ , bytestring , zlib , zlib-bindings- , hspec+ , hspec >= 1.3 , QuickCheck >= 2.3- , HUnit ghc-options: -Wall source-repository head