diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-05-05 08:09:19 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-05-05 10:52:20 +0200 |
| commit | 1eda917b0920f7886f38714ac68a5a2f8cb79360 (patch) | |
| tree | b5ed870282fd120f8cb4d15b35144d793f46ef75 /test | |
| parent | fcdf2aa7a2547e1daf07477a8db11abacff8225e (diff) | |
shape.c: finalize the "offset" rename
To better distinguish fully formed shape ids from "naked" offsets.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_shapes.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index 717ef48a1f..d50b59c1d8 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -95,15 +95,15 @@ class TestShapes < Test::Unit::TestCase # shapes def assert_shape_equal(e, a) assert_equal( - {id: e.id, parent_id: e.parent_id, depth: e.depth, type: e.type}, - {id: a.id, parent_id: a.parent_id, depth: a.depth, type: a.type}, + {id: e.id, parent_offset: e.parent_offset, depth: e.depth, type: e.type}, + {id: a.id, parent_offset: a.parent_offset, depth: a.depth, type: a.type}, ) end def refute_shape_equal(e, a) refute_equal( - {id: e.id, parent_id: e.parent_id, depth: e.depth, type: e.type}, - {id: a.id, parent_id: a.parent_id, depth: a.depth, type: a.type}, + {id: e.id, parent_offset: e.parent_offset, depth: e.depth, type: e.type}, + {id: a.id, parent_offset: a.parent_offset, depth: a.depth, type: a.type}, ) end @@ -1032,7 +1032,7 @@ class TestShapes < Test::Unit::TestCase example.add_foo # makes a transition add_foo_shape = RubyVM::Shape.of(example) assert_equal([:@foo], example.instance_variables) - assert_equal(initial_shape.raw_id, add_foo_shape.parent.raw_id) + assert_equal(initial_shape.offset, add_foo_shape.parent.offset) assert_equal(1, add_foo_shape.next_field_index) example.remove_foo # makes a transition @@ -1043,7 +1043,7 @@ class TestShapes < Test::Unit::TestCase example.add_bar # makes a transition bar_shape = RubyVM::Shape.of(example) assert_equal([:@bar], example.instance_variables) - assert_equal(initial_shape.raw_id, bar_shape.parent_id) + assert_equal(initial_shape.offset, bar_shape.parent_offset) assert_equal(1, bar_shape.next_field_index) end @@ -1097,7 +1097,7 @@ class TestShapes < Test::Unit::TestCase def test_root_shape_frozen frozen_root_shape = RubyVM::Shape.of([].freeze) assert_predicate(frozen_root_shape, :frozen?) - assert_equal(RubyVM::Shape.root_shape.id, frozen_root_shape.raw_id) + assert_equal(RubyVM::Shape.root_shape.id, frozen_root_shape.offset) end def test_basic_shape_transition |
