testIdentity2 :: Test
testIdentity2 = testProperty "gzip/identity2" $ monadicIO $
                forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goDeflate (seqSnap $ withCompression $ textPlain s)

        assertEqual "" (Just "deflate") $ getHeader "Content-Encoding" rsp
        assertEqual "" (Just "Accept-Encoding") $ getHeader "Vary" rsp

        body <- Test.getResponseBody rsp
        let s' = Zlib.decompress $ L.fromChunks [body]
        assertEqual "" s s'


------------------------------------------------------------------------------
testIdentity2 :: Test
testIdentity2 = testProperty "gzip/identity2" $ monadicIO $
                forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goDeflate (seqSnap $ withCompression $ textPlain s)

        assertEqual "" (Just "deflate") $ getHeader "Content-Encoding" rsp
        assertEqual "" (Just "Accept-Encoding") $ getHeader "Vary" rsp

        body <- Test.getResponseBody rsp
        let s' = Zlib.decompress $ L.fromChunks [body]
        assertEqual "" s s'


------------------------------------------------------------------------------
testIdentity2 = testProperty "gzip/identity2" $ monadicIO $
                forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goDeflate (seqSnap $ withCompression $ textPlain s)

        assertEqual "" (Just "deflate") $ getHeader "Content-Encoding" rsp
        assertEqual "" (Just "Accept-Encoding") $ getHeader "Vary" rsp

        body <- Test.getResponseBody rsp
        let s' = Zlib.decompress $ L.fromChunks [body]
        assertEqual "" s s'


------------------------------------------------------------------------------