2019-09-15 18:57:15 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
|
|
|
class TestNotSameCheck < SlotMachineInstructionTest
|
2019-09-15 18:57:15 +02:00
|
|
|
def instruction
|
2020-02-11 10:19:52 +01:00
|
|
|
target = Slot.for(:message , :caller)
|
2019-09-15 18:57:15 +02:00
|
|
|
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
|
2019-09-17 09:16:59 +02:00
|
|
|
assert_operator risc(3) , :-, :r2 , :r4
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
def test_4_zero
|
2019-09-17 09:16:59 +02:00
|
|
|
assert_zero risc(4) , "target"
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|