testGzipLotsaChunks :: Test
testGzipLotsaChunks = testCase "gzip/lotsOfChunks" prop
  where
    prop = do
        a <- genRandom 12000
        let s = L.take 120000 $ L.cycle $ L.fromChunks [a, B.reverse a]
        (!_,!rsp) <- goGZip (seqSnap $ withCompression $ textPlain s)

        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        H.assertEqual "streams equal" s s1

    genRandom n = B.pack <$> replicateM n randomWord8

    t8 c = toEnum $ c .&. 0xff

    randomWord8 :: IO Word8
    randomWord8 = t8 <$> randomIO


------------------------------------------------------------------------------
testGzipLotsaChunks :: Test
testGzipLotsaChunks = testCase "gzip/lotsOfChunks" prop
  where
    prop = do
        a <- genRandom 12000
        let s = L.take 120000 $ L.cycle $ L.fromChunks [a, B.reverse a]
        (!_,!rsp) <- goGZip (seqSnap $ withCompression $ textPlain s)

        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        H.assertEqual "streams equal" s s1

    genRandom n = B.pack <$> replicateM n randomWord8

    t8 c = toEnum $ c .&. 0xff

    randomWord8 :: IO Word8
    randomWord8 = t8 <$> randomIO


------------------------------------------------------------------------------
testGzipLotsaChunks = testCase "gzip/lotsOfChunks" prop
  where
    prop = do
        a <- genRandom 12000
        let s = L.take 120000 $ L.cycle $ L.fromChunks [a, B.reverse a]
        (!_,!rsp) <- goGZip (seqSnap $ withCompression $ textPlain s)

        body <- Test.getResponseBody rsp
        let s1 = GZip.decompress $ L.fromChunks [body]
        H.assertEqual "streams equal" s s1

    genRandom n = B.pack <$> replicateM n randomWord8

    t8 c = toEnum $ c .&. 0xff

    randomWord8 :: IO Word8
    randomWord8 = t8 <$> randomIO


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