diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2026-02-07 21:49:23 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2026-02-08 10:28:52 -0500 |
| commit | 40117ea04b7b5ff5a41f4d5ad4159692eca93bdd (patch) | |
| tree | 01d6ac2e456f21408ed606fee62b95c4b0152966 /test | |
| parent | cbf6e775ee180cc4db49289f0db774d489fb9a4c (diff) | |
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.
Diffstat (limited to 'test')
| -rw-r--r-- | test/objspace/test_objspace.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 8b369c3894..d631f97d1b 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -703,8 +703,9 @@ class TestObjSpace < Test::Unit::TestCase end def test_dump_includes_slot_size - str = "TEST" - dump = ObjectSpace.dump(str) + klass = Class.new + obj = klass.new + dump = ObjectSpace.dump(obj) assert_includes dump, "\"slot_size\":#{GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE]}" end |
