fix type api

tests were using methods that were only used in tests.
This commit is contained in:
Torsten Ruger
2018-05-14 16:13:50 +03:00
parent 3c00239f36
commit 5d3c70da89
3 changed files with 23 additions and 44 deletions

View File

@ -54,8 +54,8 @@ module Vool
VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5; @ibar = 4;end")
test = Parfait.object_space.get_class_by_name(:Test)
method = test.instance_type.get_method(:meth)
assert_equal 2, method.for_type.variable_index(:ivar)
assert_equal 3, method.for_type.variable_index(:ibar)
assert_equal 1, method.for_type.variable_index(:ivar)
assert_equal 2, method.for_type.variable_index(:ibar)
end
def test_vool_method_has_one_local
@ -63,7 +63,8 @@ module Vool
test = Parfait.object_space.get_class_by_name(:Test)
method = test.get_method(:meth)
assert_equal 3 , method.frame_type.instance_length
assert_equal 2 , method.frame_type.variable_index(:local)
assert_equal 1 , method.frame_type.variable_index(:local)
assert_equal 2 , method.frame_type.variable_index(:a)
end
def test_typed_method_has_one_local
@ -71,7 +72,7 @@ module Vool
test = Parfait.object_space.get_class_by_name(:Test)
method = test.instance_type.get_method(:meth)
assert_equal 3 , method.frame_type.instance_length
assert_equal 2 , method.frame_type.variable_index(:local)
assert_equal 1 , method.frame_type.variable_index(:local)
end
end