rubyx/test/vool/to_mom/test_while_condition.rb
Torsten Ruger 35a0952943 first while test working
fixed logic error in test framework
2018-03-16 12:33:11 +05:30

29 lines
728 B
Ruby

require_relative "helper"
module Vool
class TestWhileConditionMom < MiniTest::Test
include MomCompile
include Mom
def setup
Risc.machine.boot
@ins = compile_first_method( "while(5.mod4) ; 5.mod4 ; end")
end
def test_condition_compiles_to_check
assert_equal TruthCheck , @ins.next(6).class
end
def test_condition_is_slot
assert_equal SlotDefinition , @ins.next(6).condition.class , @ins
end
def test_hoisetd
assert_equal MessageSetup , @ins.class
end
def test_array
check_array [MessageSetup,SlotLoad,ArgumentTransfer,SimpleCall,SlotLoad,Label,TruthCheck,MessageSetup,SlotLoad,ArgumentTransfer,SimpleCall,Jump,Label] , @ins
end
end
end