fix all mom tests

still quite brittle, but easy to fix
This commit is contained in:
2019-08-23 19:24:18 +03:00
parent 1eb6430880
commit 4656ea8ffb
19 changed files with 93 additions and 86 deletions

View File

@ -7,10 +7,10 @@ module Risc
def setup
super
@input = "r = 5.div4;return"
@expect = [LoadConstant, RegToSlot, LoadConstant, SlotToReg, RegToSlot, #4
LoadConstant, SlotToReg, RegToSlot, SlotToReg, FunctionCall, #9
Label, SlotToReg, RegToSlot, LoadConstant, RegToSlot, #14
Branch,] #19
@expect = [LoadConstant, SlotToReg, RegToSlot, LoadConstant, SlotToReg, #5
RegToSlot, LoadConstant, SlotToReg, RegToSlot, SlotToReg, #10
FunctionCall, Label, SlotToReg, RegToSlot, LoadConstant, #15
RegToSlot, Branch,] #20
end
def test_local_assign_instructions
assert_nil msg = check_nil , msg
@ -18,7 +18,7 @@ module Risc
def test_constant_load
produced = produce_body
load = produced.next(2)
load = produced.next(3)
assert_equal LoadConstant , load.class
assert_equal 5 , load.constant.value
end