Skip to content

Commit 40e85f2

Browse files
authored
Merge pull request #201 from ruby/claude/elastic-hamilton-f492d1
Fix test_gets_separator_modified_by_io with mmtk
2 parents 8d481b6 + 2a9680c commit 40e85f2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎test/zlib/test_zlib.rb‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,10 @@ def test_read0
12821282
end
12831283

12841284
def test_gets_separator_modified_by_io
1285-
rs = "-" * 1000
1285+
# grown from an empty string so that the content lives in a separate
1286+
# buffer even with a GC that embeds 1000 bytes in the object (mmtk)
1287+
rs = "".dup
1288+
rs << "-" * 1000
12861289
src = StringIO.new(Zlib.gzip(Random.new(0).bytes(200_000).tr("-", "x") + rs))
12871290
n = 0
12881291
io = Object.new

0 commit comments

Comments
 (0)