rubyx/test/slot_machine/instructions/test_slot_load1.rb
Torsten db5a59f735 Unify instruction namings also dirs
Was getting confused myself, where it was instruction or instructions, when if the base class was inside or out of dir.
Now dirs are plural, and base class is inside.
2020-03-22 14:31:43 +02:00

40 lines
1.1 KiB
Ruby

require_relative "helper"
module SlotMachine
class TestSlotLoad1 < MiniTest::Test
def setup
Parfait.boot!(Parfait.default_test_options)
load = SlotLoad.new("test", [:message, :caller] , [:message,:type] )
compiler = Risc.test_compiler
load.to_risc(compiler)
@instructions = compiler.risc_instructions.next
end
def test_ins_class
assert_equal Risc::SlotToReg , @instructions.class
end
def test_ins_next_class
assert_equal Risc::RegToSlot , @instructions.next.class
end
def test_ins_arr
assert_equal :message , @instructions.array.symbol
end
def test_ins_reg
assert_equal :"message.type" , @instructions.register.symbol
end
def test_ins_index
assert_equal 0 , @instructions.index
end
def test_ins_next_reg
assert_equal :"message.type" , @instructions.next.register.symbol
end
def test_ins_next_arr
assert_equal :message , @instructions.next.array.symbol
end
def test_ins_next_index
assert_equal 6 , @instructions.next.index
end
end
end