Skip to content

Commit 1aa7659

Browse files
peterzhu2118paracycle
authored andcommitted
Use Object for ObjectSpace.dump test
This test fails if BASE_SLOT_SIZE is 32 bytes because Strings occupy 40 bytes. Objects are smaller and would be 40 bytes.
1 parent 15c712f commit 1aa7659

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/objspace/test_objspace.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,9 @@ def test_dump_escapes_method_name
703703
end
704704

705705
def test_dump_includes_slot_size
706-
str = "TEST"
707-
dump = ObjectSpace.dump(str)
706+
klass = Class.new
707+
obj = klass.new
708+
dump = ObjectSpace.dump(obj)
708709

709710
assert_includes dump, "\"slot_size\":#{GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE]}"
710711
end

0 commit comments

Comments
 (0)