Skip to content

Commit bdbafe0

Browse files
committed
Don’t reuse huge string in test to save 4 GB RAM at runtime
1 parent b14dced commit bdbafe0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

zlib/test/Test.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ test_exception = ioProperty $ do
288288
Right{} -> counterexample "expected exception" False
289289

290290
test_compress_large_chunk :: Property
291-
test_compress_large_chunk = GZip.decompress (GZip.compress xs) === xs
291+
test_compress_large_chunk =
292+
GZip.decompress (GZip.compress (BL.replicate len 0)) === BL.replicate len 0
292293
where
293294
len = case finiteBitSize (0 :: Int) of
294295
64 -> (1 `shiftL` 32) + 1
295296
_ -> 0 -- ignore it
296-
xs = BL.fromStrict $ BS.replicate len 0
297297

298298
toStrict :: BL.ByteString -> BS.ByteString
299299
#if MIN_VERSION_bytestring(0,10,0)

0 commit comments

Comments
 (0)