Remove assumption about object order

The address of objects can't be assumed since a later object may be
allocate in a swept slot.
This commit is contained in:
Peter Zhu 2023-07-18 11:00:58 -04:00
Родитель 4c03eab1aa
Коммит ecbedf9bf1
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -632,7 +632,13 @@ class TestObjSpace < Test::Unit::TestCase
end
end
entry_hash = JSON.parse(test_string_in_dump_all[1])
strs = test_string_in_dump_all.reject do |s|
s.include?("fstring")
end
assert_equal(1, strs.length)
entry_hash = JSON.parse(strs[0])
assert_equal(5, entry_hash["bytesize"], "bytesize is wrong")
assert_equal("TEST2", entry_hash["value"], "value is wrong")