2017-09-05 11:04:52 +02:00
|
|
|
|
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Vool
|
|
|
|
class TestWhileConditionMom < MiniTest::Test
|
|
|
|
include MomCompile
|
2018-03-16 08:03:11 +01:00
|
|
|
include Mom
|
2017-09-05 11:04:52 +02:00
|
|
|
|
|
|
|
def setup
|
|
|
|
Risc.machine.boot
|
2018-03-16 08:03:11 +01:00
|
|
|
@ins = compile_first_method( "while(5.mod4) ; 5.mod4 ; end")
|
2017-09-05 11:04:52 +02:00
|
|
|
end
|
|
|
|
|
2018-03-16 08:03:11 +01:00
|
|
|
def test_condition_compiles_to_check
|
2018-03-20 19:01:42 +01:00
|
|
|
assert_equal TruthCheck , @ins.next(5).class
|
2017-09-05 11:04:52 +02:00
|
|
|
end
|
|
|
|
def test_condition_is_slot
|
2018-03-20 19:01:42 +01:00
|
|
|
assert_equal SlotDefinition , @ins.next(5).condition.class , @ins
|
2017-09-05 11:04:52 +02:00
|
|
|
end
|
|
|
|
def test_hoisetd
|
2018-03-16 08:03:11 +01:00
|
|
|
assert_equal MessageSetup , @ins.class
|
|
|
|
end
|
|
|
|
def test_array
|
2018-03-20 19:01:42 +01:00
|
|
|
check_array [MessageSetup,ArgumentTransfer,SimpleCall,SlotLoad,Label,TruthCheck,MessageSetup,ArgumentTransfer,SimpleCall,Jump,Label] , @ins
|
2017-09-05 11:04:52 +02:00
|
|
|
end
|
2018-03-16 08:03:11 +01:00
|
|
|
|
2017-09-05 11:04:52 +02:00
|
|
|
end
|
|
|
|
end
|