dynamic call green

This commit is contained in:
Torsten Ruger 2018-03-16 20:02:22 +05:30
parent ba3ec9b1a2
commit f50327eb94

View File

@ -9,38 +9,19 @@ module Vool
Risc.machine.boot Risc.machine.boot
@ins = compile_first_method_flat( "a = 5; a.mod4") @ins = compile_first_method_flat( "a = 5; a.mod4")
end end
def test_if_first def test_check_type
assert_equal IfStatement , @ins.class , @ins assert_equal NotSameCheck , @ins.next.class , @ins
end end
def test_if_condition_set def test_type_update
assert_equal NotSameCheck , @ins.condition.class , @ins load = @ins.next(2)
assert_equal :receiver , load.right.known_object , load
assert_equal :type , load.right.slots[0] , load
end end
def test_if_true_moves_type def test_check_resolve_call
assert_equal @ins.if_true[0].class, SlotLoad , @ins.if_true.to_rxf assert_equal SimpleCall , @ins.next(6).class , @ins
end end
def test_if_true_resolves_setup def test_dynamic_call_last
assert_equal @ins.if_true[1].class , MessageSetup, @ins.if_true.to_rxf assert_equal DynamicCall , @ins.last.class , @ins
end
def test_if_true_resolves_transfer
assert_equal @ins.if_true[2].class , ArgumentTransfer, @ins.if_true.to_rxf
end
def test_if_true_resolves_call
assert_equal @ins.if_true[3].class , SimpleCall, @ins.if_true.to_rxf
end
def test_if_true_resolves_move
assert_equal @ins.if_true[4].class , SlotLoad, @ins.if_true.to_rxf
end
def test_setup_second
assert_equal MessageSetup , @ins.next.class , @second.to_rxf
end
def test_transfer_third
assert_equal ArgumentTransfer , @ins.next(2).class , @third.to_rxf
end
def test_call_third
assert_equal DynamicCall , @ins.last.class , @fourth.to_rxf
end end
def test_array def test_array