2019-09-15 17:31:10 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
|
|
|
class TestArgumentTransfer < SlotMachineInstructionTest
|
2019-09-15 17:31:10 +02:00
|
|
|
def instruction
|
2020-02-27 17:19:27 +01:00
|
|
|
receiver = SlottedMessage.new( [:arg1])
|
|
|
|
arg = SlottedMessage.new( [:receiver , :type])
|
2019-09-15 17:31:10 +02:00
|
|
|
ArgumentTransfer.new("" , receiver ,[arg])
|
|
|
|
end
|
|
|
|
def test_len
|
2020-02-27 17:19:27 +01:00
|
|
|
assert_equal 8 , all.length , all_str
|
2019-09-15 17:31:10 +02:00
|
|
|
end
|
|
|
|
def test_1_slot
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 1,:message , 9 , :"message.arg1"
|
2019-09-15 17:31:10 +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 17:31:10 +02:00
|
|
|
end
|
|
|
|
def test_3_reg
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_reg_to_slot 3, :"message.arg1" , :"message.next_message" , 2
|
2019-09-15 17:31:10 +02:00
|
|
|
end
|
|
|
|
def test_4_slot
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 4,:message , 2 , :"message.receiver"
|
2019-09-15 17:31:10 +02:00
|
|
|
end
|
2020-02-27 17:19:27 +01:00
|
|
|
def test_5
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 5,:"message.receiver" , 0 , :"message.receiver.type"
|
2020-02-27 17:19:27 +01:00
|
|
|
end
|
|
|
|
def test_6
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_slot_to_reg 6,:message , 1 , :"message.next_message"
|
2020-02-27 17:19:27 +01:00
|
|
|
end
|
|
|
|
def test_7
|
2020-03-08 16:31:16 +01:00
|
|
|
assert_reg_to_slot 7, :"message.receiver.type" , :"message.next_message" , 9
|
2019-09-15 17:31:10 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|