mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
Switch shape test to use exhaust_shapes
This commit is contained in:
parent
974d18fd0c
commit
fb7add4954
1 changed files with 4 additions and 9 deletions
|
@ -132,17 +132,12 @@ class TestShapes < Test::Unit::TestCase
|
||||||
begin;
|
begin;
|
||||||
class Hi; end
|
class Hi; end
|
||||||
|
|
||||||
obj = Hi.new
|
RubyVM::Shape.exhaust_shapes(2)
|
||||||
i = 0
|
|
||||||
while RubyVM::Shape.shapes_available > 2
|
|
||||||
obj.instance_variable_set(:"@a#{i}", 1)
|
|
||||||
i += 1
|
|
||||||
end
|
|
||||||
|
|
||||||
obj = Hi.new
|
obj = Hi.new
|
||||||
obj.instance_variable_set(:"@b", 1)
|
obj.instance_variable_set(:@b, 1)
|
||||||
obj.instance_variable_set(:"@c", 1)
|
obj.instance_variable_set(:@c, 1)
|
||||||
obj.instance_variable_set(:"@d", 1)
|
obj.instance_variable_set(:@d, 1)
|
||||||
|
|
||||||
assert_predicate RubyVM::Shape.of(obj), :too_complex?
|
assert_predicate RubyVM::Shape.of(obj), :too_complex?
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue