diff options
Diffstat (limited to 'test/ruby/test_shapes.rb')
-rw-r--r-- | test/ruby/test_shapes.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index 6d98daf233..b9ac1cafe1 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -226,6 +226,26 @@ class TestShapes < Test::Unit::TestCase end; end + def test_run_out_of_shape_generic_ivar_set + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + class TooComplex < Hash + end + + # Try to run out of shapes + o = Object.new + i = 0 + while RubyVM::Shape.shapes_available > 0 + o.instance_variable_set(:"@i#{i}", 1) + i += 1 + end + + tc = TooComplex.new + tc.instance_variable_set(:@a, 1) + tc.instance_variable_set(:@b, 2) + end; + end + def test_run_out_of_shape_rb_obj_copy_ivar assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") begin; |