testIdentity4 :: Test
testIdentity4 = testProperty "gzip/identity4" $ monadicIO $ forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goXGZip (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp)
        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        assertEqual "identity" s s1

        (!_,!rsp2) <- goXGZip2 (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp2)
        body2 <- Test.getResponseBody rsp2
        let s2 = GZip.decompress $ L.fromChunks [body2]
        assertEqual "identity2" s s2


------------------------------------------------------------------------------
testIdentity4 :: Test
testIdentity4 = testProperty "gzip/identity4" $ monadicIO $ forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goXGZip (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp)
        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        assertEqual "identity" s s1

        (!_,!rsp2) <- goXGZip2 (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp2)
        body2 <- Test.getResponseBody rsp2
        let s2 = GZip.decompress $ L.fromChunks [body2]
        assertEqual "identity2" s s2


------------------------------------------------------------------------------
testIdentity4 = testProperty "gzip/identity4" $ monadicIO $ forAllM arbitrary prop
  where
    prop :: L.ByteString -> PropertyM IO ()
    prop s = liftQ $ do
        (!_,!rsp) <- goXGZip (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp)
        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        assertEqual "identity" s s1

        (!_,!rsp2) <- goXGZip2 (seqSnap $ withCompression $ textPlain s)
        assertEqual "encoding" (Just "x-gzip") (getHeader "Content-Encoding" rsp2)
        body2 <- Test.getResponseBody rsp2
        let s2 = GZip.decompress $ L.fromChunks [body2]
        assertEqual "identity2" s s2


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