2018-05-15 18:29:27 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Mom
|
2018-05-16 11:35:44 +02:00
|
|
|
class TestSlotLoadBasics < MiniTest::Test
|
|
|
|
|
|
|
|
def test_ins_ok
|
2019-08-12 23:13:29 +02:00
|
|
|
assert SlotLoad.new("test", [:message, :caller] , [:receiver,:type] )
|
2018-05-16 11:35:44 +02:00
|
|
|
end
|
|
|
|
def test_ins_fail1
|
2019-08-12 23:13:29 +02:00
|
|
|
assert_raises {SlotLoad.new( "test",[:message, :caller] , nil )}
|
2018-05-16 11:35:44 +02:00
|
|
|
end
|
|
|
|
def test_fail_on_right
|
2019-08-12 23:13:29 +02:00
|
|
|
@load = SlotLoad.new( "test",[:message, :caller] , [:receiver,:type] )
|
2018-07-16 10:46:18 +02:00
|
|
|
assert_raises {@load.to_risc(Risc::FakeCompiler.new)}
|
2018-05-16 11:35:44 +02:00
|
|
|
end
|
|
|
|
def test_fail_on_left_long
|
2019-08-12 23:13:29 +02:00
|
|
|
@load = SlotLoad.new("test", [:message, :caller , :type] , [:receiver,:type] )
|
2018-07-16 10:46:18 +02:00
|
|
|
assert_raises {@load.to_risc(Risc::FakeCompiler.new)}
|
2018-05-16 11:35:44 +02:00
|
|
|
end
|
|
|
|
end
|
2018-05-15 18:29:27 +02:00
|
|
|
end
|