2017-09-11 20:30:28 +02:00
|
|
|
module Vool
|
2018-03-15 17:24:03 +01:00
|
|
|
# relies on @ins and receiver_type method
|
2017-09-11 20:30:28 +02:00
|
|
|
module SimpleSendHarness
|
|
|
|
def test_compiles_not_array
|
2018-03-15 17:24:03 +01:00
|
|
|
assert Array != @ins.class , @ins
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_class_compiles
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal Mom::MessageSetup , @ins.class , @ins
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_two_instructions_are_returned
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal 4 , @ins.length , @ins
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_receiver_move_class
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal Mom::ArgumentTransfer, @ins.next(2).class
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_receiver_move
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal :receiver, @ins.next(1).left.slots[1]
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_receiver
|
|
|
|
type , value = receiver
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal type, @ins.next.right.class
|
|
|
|
assert_equal value, @ins.next.right.value
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_call_is
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal Mom::SimpleCall, @ins.next(3).class
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
def test_call_has_method
|
2018-03-15 17:24:03 +01:00
|
|
|
assert_equal Parfait::TypedMethod, @ins.next(3).method.class
|
2017-09-11 20:30:28 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|