fixing most of the risc tests

This commit is contained in:
2019-08-23 15:31:22 +03:00
parent 50c172915e
commit 4ca16e5f9a
21 changed files with 265 additions and 293 deletions

View File

@ -19,7 +19,7 @@ module Risc
@instruction_events << was
end
def length
37
27
end
def test_state_change
@interpreter.register_event :state_changed , self
@ -39,14 +39,13 @@ module Risc
def test_chain
#show_ticks # get output of what is
check_chain [Branch, LoadConstant, SlotToReg, SlotToReg, RegToSlot,
LoadConstant, LoadConstant, SlotToReg, SlotToReg, RegToSlot, # 10
RegToSlot, RegToSlot, RegToSlot, SlotToReg, LoadConstant,
RegToSlot, LoadConstant, RegToSlot, FunctionCall, LoadConstant, # 20
RegToSlot, Branch, SlotToReg, SlotToReg, RegToSlot,
LoadConstant, SlotToReg, RegToSlot, RegToSlot, SlotToReg, # 30
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg,
SlotToReg, Syscall, NilClass, ]
check_chain [Branch, LoadConstant, SlotToReg, SlotToReg, RegToSlot, #5
LoadConstant, RegToSlot, SlotToReg, LoadConstant, RegToSlot, #10
LoadConstant, RegToSlot, FunctionCall, LoadConstant, RegToSlot, #15
Branch, SlotToReg, SlotToReg, RegToSlot, SlotToReg, #20
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg, #25
SlotToReg, Syscall, NilClass,] #30
assert_equal ::Integer , get_return.class
assert_equal 5 , get_return
end