diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-11-24 14:48:02 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-11-24 14:48:02 -0500 |
commit | fb7add495454322ea00efa7549feb957cb1ca538 (patch) | |
tree | f6541fc9353a3ba5da7f7e6d136e75766421601b | |
parent | 974d18fd0c13bd19120cad70187f5b646c901dff (diff) | |
download | ruby-fb7add495454322ea00efa7549feb957cb1ca538.tar.gz |
Switch shape test to use exhaust_shapes
-rw-r--r-- | test/ruby/test_shapes.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index 7919a210a7..c4b0d251f1 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -132,17 +132,12 @@ class TestShapes < Test::Unit::TestCase begin; class Hi; end - obj = Hi.new - i = 0 - while RubyVM::Shape.shapes_available > 2 - obj.instance_variable_set(:"@a#{i}", 1) - i += 1 - end + RubyVM::Shape.exhaust_shapes(2) obj = Hi.new - obj.instance_variable_set(:"@b", 1) - obj.instance_variable_set(:"@c", 1) - obj.instance_variable_set(:"@d", 1) + obj.instance_variable_set(:@b, 1) + obj.instance_variable_set(:@c, 1) + obj.instance_variable_set(:@d, 1) assert_predicate RubyVM::Shape.of(obj), :too_complex? end; |