2018-05-15 18:29:27 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
2018-05-16 11:35:44 +02:00
|
|
|
class TestSlotLoadBasics < MiniTest::Test
|
|
|
|
|
2020-02-11 10:03:51 +01:00
|
|
|
def setup
|
|
|
|
Parfait.boot!({})
|
|
|
|
end
|
2018-05-16 11:35:44 +02:00
|
|
|
def test_ins_ok
|
2020-02-11 10:03:51 +01:00
|
|
|
assert SlotLoad.new("test", [:message, :caller] , [:message , :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
|
2020-02-11 10:03:51 +01:00
|
|
|
def pest_fail_on_right
|
|
|
|
load = SlotLoad.new( "test",[:message, :caller] , [:message ,:receiver,:type] )
|
2020-02-28 11:54:17 +01:00
|
|
|
assert_raises {load.to_risc(Risc.test_compiler)}
|
2018-05-16 11:35:44 +02:00
|
|
|
end
|
2020-02-11 10:03:51 +01:00
|
|
|
def pest_fail_on_left_long
|
|
|
|
load = SlotLoad.new("test", [:message, :caller , :type , :type] , [:message,:type] )
|
2020-02-28 11:54:17 +01:00
|
|
|
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
|