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-17 08:45:54 +01:00
|
|
|
target = Slotted.for(:message , [:caller])
|
2020-03-01 15:41:58 +01:00
|
|
|
target2 = Slotted.for(:message , [:next_message])
|
|
|
|
NotSameCheck.new(target , target2 , Label.new("ok" , "target"))
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
def test_len
|
|
|
|
assert_equal 5 , all.length , all_str
|
|
|
|
end
|
|
|
|
def test_1_slot
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 1,:message , 6 , :"message.caller"
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
def test_2_slot
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 2,:message , 1 , :"message.next_message"
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
def test_3_op
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_operator 3, :-, :"message.caller" , :"message.next_message"
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
def test_4_zero
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_not_zero 4, "target"
|
2019-09-15 18:57:15 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|