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
parent 4c03eab1aa
commit ecbedf9bf1
Notes: git 2023-07-18 18:52:57 +00:00

View File

@ -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")