From bdbafe0bb80350aa5af2afbc145251efa67eb43c Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Sat, 31 May 2025 20:14:37 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20reuse=20huge=20string=20in=20te?= =?UTF-8?q?st=20to=20save=204=20GB=20RAM=20at=20runtime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zlib/test/Test.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zlib/test/Test.hs b/zlib/test/Test.hs index 4b2e0f0..0b546ac 100644 --- a/zlib/test/Test.hs +++ b/zlib/test/Test.hs @@ -288,12 +288,12 @@ test_exception = ioProperty $ do Right{} -> counterexample "expected exception" False test_compress_large_chunk :: Property -test_compress_large_chunk = GZip.decompress (GZip.compress xs) === xs +test_compress_large_chunk = + GZip.decompress (GZip.compress (BL.replicate len 0)) === BL.replicate len 0 where len = case finiteBitSize (0 :: Int) of 64 -> (1 `shiftL` 32) + 1 _ -> 0 -- ignore it - xs = BL.fromStrict $ BS.replicate len 0 toStrict :: BL.ByteString -> BS.ByteString #if MIN_VERSION_bytestring(0,10,0)