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

@ -11,12 +11,11 @@ module Risc
def test_if
#show_main_ticks # get output of what is in main
check_main_chain [LoadConstant, LoadConstant, OperatorInstruction, IsZero, LoadConstant,
OperatorInstruction, IsZero, LoadConstant, RegToSlot, Branch, # 10
SlotToReg, SlotToReg, RegToSlot, LoadConstant, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg, # 20
FunctionReturn, Transfer, SlotToReg, SlotToReg, Syscall,
NilClass, ]
check_main_chain [LoadConstant, LoadConstant, OperatorInstruction, IsZero, LoadConstant, #5
OperatorInstruction, IsZero, LoadConstant, RegToSlot, Branch, #10
SlotToReg, SlotToReg, RegToSlot, SlotToReg, SlotToReg, #15
SlotToReg, FunctionReturn, Transfer, SlotToReg, SlotToReg, #20
Syscall, NilClass,] #25
assert_equal 1 , get_return
end
def test_load_10
@ -39,9 +38,5 @@ module Risc
assert_equal IsZero , check.class
assert check.label.name.start_with?("false_label") , check.label.name
end
def test_exit
done = main_ticks(25)
assert_equal Syscall , done.class
end
end
end