rubyx/test/slot_machine/instruction/test_not_same_check.rb
Torsten Rüger 24d7fe25da first steps to defining specialised slot classes
getting rid of the mess in SlotDefinition (wip)
2020-02-10 18:36:21 +07:00

26 lines
619 B
Ruby

require_relative "helper"
module SlotMachine
class TestNotSameCheck < SlotMachineInstructionTest
def instruction
target = SlotDefinition.for(:message , :caller)
NotSameCheck.new(target , target , Label.new("ok" , "target"))
end
def test_len
assert_equal 5 , all.length , all_str
end
def test_1_slot
assert_slot_to_reg risc(1) ,:r0 , 6 , :r2
end
def test_2_slot
assert_slot_to_reg risc(2) ,:r0 , 6 , :r4
end
def test_3_op
assert_operator risc(3) , :-, :r2 , :r4
end
def test_4_zero
assert_zero risc(4) , "target"
end
end
end