diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 2e4f83c..cfe1537 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -1282,7 +1282,10 @@ def test_read0 end def test_gets_separator_modified_by_io - rs = "-" * 1000 + # grown from an empty string so that the content lives in a separate + # buffer even with a GC that embeds 1000 bytes in the object (mmtk) + rs = "".dup + rs << "-" * 1000 src = StringIO.new(Zlib.gzip(Random.new(0).bytes(200_000).tr("-", "x") + rs)) n = 0 io = Object.new