implement greater than
This commit is contained in:
@ -29,10 +29,22 @@ module Risc
|
||||
run_all "4 * 4"
|
||||
assert_equal 16 , get_return.value
|
||||
end
|
||||
def test_smaller
|
||||
def test_smaller_true
|
||||
run_all "4 < 5"
|
||||
assert_equal Parfait::TrueClass , get_return.class
|
||||
end
|
||||
def test_smaller_false
|
||||
run_all "6 < 5"
|
||||
assert_equal Parfait::FalseClass , get_return.class
|
||||
end
|
||||
def test_larger_true
|
||||
run_all "5 > 4"
|
||||
assert_equal Parfait::TrueClass , get_return.class
|
||||
end
|
||||
def test_larger_false
|
||||
run_all "5 > 6"
|
||||
assert_equal Parfait::FalseClass , get_return.class
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -11,13 +11,17 @@ module Risc
|
||||
|
||||
def test_chain
|
||||
#show_main_ticks # get output of what is
|
||||
check_main_chain [Label, LoadConstant, SlotToReg, RegToSlot, LoadConstant,
|
||||
check_main_chain [Label, LoadConstant, SlotToReg, RegToSlot, LoadConstant,
|
||||
SlotToReg, SlotToReg, SlotToReg, SlotToReg, OperatorInstruction,
|
||||
IsZero, SlotToReg, SlotToReg, SlotToReg, LoadConstant,
|
||||
RegToSlot, LoadConstant, LoadConstant, SlotToReg, SlotToReg,
|
||||
Label, LoadConstant, SlotToReg, OperatorInstruction, IsZero,
|
||||
SlotToReg, OperatorInstruction, IsZero, SlotToReg, Branch,
|
||||
Label, LoadConstant, SlotToReg, OperatorInstruction, IsZero,
|
||||
SlotToReg, OperatorInstruction, IsZero, SlotToReg, Branch,
|
||||
Label, LoadConstant, SlotToReg, OperatorInstruction, IsZero,
|
||||
SlotToReg, OperatorInstruction, IsZero, SlotToReg, Branch,
|
||||
Label, LoadConstant, SlotToReg, OperatorInstruction, IsZero,
|
||||
SlotToReg, OperatorInstruction, IsZero, Label, RegToSlot,
|
||||
Label, LoadConstant, SlotToReg, LoadConstant, SlotToReg,
|
||||
RegToSlot, RegToSlot, SlotToReg, SlotToReg, RegToSlot,
|
||||
@ -47,16 +51,16 @@ module Risc
|
||||
end
|
||||
|
||||
def test_dyn
|
||||
cal = main_ticks(68)
|
||||
cal = main_ticks(88)
|
||||
assert_equal DynamicJump , cal.class
|
||||
end
|
||||
#should end in exit, but doesn't, becasue resolve never returns
|
||||
def test_sys
|
||||
sys = main_ticks(99)
|
||||
sys = main_ticks(119)
|
||||
assert_equal Syscall , sys.class
|
||||
end
|
||||
def test_return
|
||||
ret = main_ticks(97)
|
||||
ret = main_ticks(117)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
link = @interpreter.get_register( ret.register )
|
||||
assert_equal Label , link.class
|
||||
|
Reference in New Issue
Block a user