rename typed_method to callable_method
seems to make the essence clearer also extracted base class
This commit is contained in:
@ -45,7 +45,7 @@ module Risc
|
||||
ret = main_ticks(63)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
assert_equal :r1 , ret.register.symbol
|
||||
assert_equal 21924 , @interpreter.get_register(ret.register)
|
||||
assert_equal 21476 , @interpreter.get_register(ret.register)
|
||||
end
|
||||
def test_sys
|
||||
sys = main_ticks(68)
|
||||
|
@ -92,7 +92,7 @@ module Risc
|
||||
assert_equal @label , ret.label
|
||||
end
|
||||
def test_minus
|
||||
op = @builder.build {space - typed_method}
|
||||
op = @builder.build {space - callable_method}
|
||||
assert_equal OperatorInstruction , op.class
|
||||
assert_equal :- , op.operator
|
||||
assert_equal :Space , op.left.type
|
||||
|
@ -54,7 +54,7 @@ module Risc
|
||||
end
|
||||
def test_pc1
|
||||
@interpreter.tick
|
||||
assert_equal 21432 , @interpreter.pc
|
||||
assert_equal 21048 , @interpreter.pc
|
||||
end
|
||||
def test_tick2
|
||||
@interpreter.tick
|
||||
@ -68,7 +68,7 @@ module Risc
|
||||
def test_pc2
|
||||
@interpreter.tick
|
||||
@interpreter.tick
|
||||
assert_equal 21436 , @interpreter.pc
|
||||
assert_equal 21052 , @interpreter.pc
|
||||
end
|
||||
def test_tick_14_jump
|
||||
14.times {@interpreter.tick}
|
||||
|
@ -25,7 +25,7 @@ module Risc
|
||||
assert_equal 0 , Position.get(@linker.cpu_init).at
|
||||
end
|
||||
def test_cpu_at
|
||||
assert_equal "0x626c" , Position.get(@linker.cpu_init.first).to_s
|
||||
assert_equal "0x60ec" , Position.get(@linker.cpu_init.first).to_s
|
||||
end
|
||||
def test_cpu_label
|
||||
assert_equal Position , Position.get(@linker.cpu_init.first).class
|
||||
|
@ -59,14 +59,14 @@ module Risc
|
||||
assert_equal Parfait::Class , vool.body.first.clazz.class
|
||||
end
|
||||
|
||||
def test_typed_method_instance_type
|
||||
def test_callable_method_instance_type
|
||||
in_test_vool("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 1, method.self_type.variable_index(:ivar)
|
||||
assert_equal 2, method.self_type.variable_index(:ibar)
|
||||
end
|
||||
def test_typed_method_has_one_local
|
||||
def test_callable_method_has_one_local
|
||||
in_test_vool("def meth; local = 5 ; a = 6;end")
|
||||
test = Parfait.object_space.get_class_by_name(:Test)
|
||||
method = test.get_method(:meth)
|
||||
|
Reference in New Issue
Block a user