Fix comparison macro

which leaves a definite need for instruction level testing
This commit is contained in:
2020-03-03 22:35:23 +02:00
parent 2af953e1d2
commit 3688c967d3
5 changed files with 34 additions and 19 deletions

View File

@ -14,22 +14,23 @@ module SlotMachine
assert_equal Risc::MethodCompiler , @method.to_risc.class
end
def test_risc_length
assert_equal 26 , @method.to_risc.risc_instructions.length
assert_equal 25 , @method.to_risc.risc_instructions.length
end
#TODO, check the actual instructions, at least by class
end
class TestIntComp2Risc < BootTest
def setup
@method = get_compiler("Integer",:gt)
@method = get_compiler("Integer",:ge)
end
def test_slot_length
assert_equal :> , @method.callable.name
assert_equal :>= , @method.callable.name
assert_equal 7 , @method.slot_instructions.length
end
def test_compile
assert_equal Risc::MethodCompiler , @method.to_risc.class
end
def test_risc_length
assert_equal 26 , @method.to_risc.risc_instructions.length
assert_equal 24 , @method.to_risc.risc_instructions.length
end
end
end