rubyx/test/slot_machine/instruction/test_slot_load.rb

25 lines
725 B
Ruby
Raw Normal View History

2018-05-15 18:29:27 +02:00
require_relative "helper"
module SlotMachine
2018-05-16 11:35:44 +02:00
class TestSlotLoadBasics < MiniTest::Test
def setup
Parfait.boot!({})
end
2018-05-16 11:35:44 +02:00
def test_ins_ok
assert SlotLoad.new("test", [:message, :caller] , [:message , :receiver,:type] )
2018-05-16 11:35:44 +02:00
end
def test_ins_fail1
assert_raises {SlotLoad.new( "test",[:message, :caller] , nil )}
2018-05-16 11:35:44 +02:00
end
def pest_fail_on_right
load = SlotLoad.new( "test",[:message, :caller] , [:message ,:receiver,:type] )
assert_raises {load.to_risc(Risc.test_compiler)}
2018-05-16 11:35:44 +02:00
end
def pest_fail_on_left_long
load = SlotLoad.new("test", [:message, :caller , :type , :type] , [:message,:type] )
assert_raises {load.to_risc(Risc.test_compiler)}
2018-05-16 11:35:44 +02:00
end
end
2018-05-15 18:29:27 +02:00
end