rubyx/test/sol/send/test_send_self.rb

37 lines
903 B
Ruby
Raw Normal View History

2018-04-26 19:26:42 +02:00
require_relative "helper"
module Sol
class TestSendSelfSlotMachine < MiniTest::Test
2017-09-11 20:30:28 +02:00
include SimpleSendHarness
2018-04-26 19:26:42 +02:00
def send_method
"self.get_internal_word(0);return"
end
2017-09-11 20:30:28 +02:00
def test_receiver
assert_equal SlottedMessage, @ins.next.receiver.class
end
def test_arg_one
assert_equal SlotLoad, @ins.next(1).arguments[0].class
end
def test_call_two
assert_equal SimpleCall, @ins.next(2).class
end
def test_call_has_method
assert_equal Parfait::CallableMethod, @ins.next(2).method.class
end
def test_call_has_right_method
assert_equal :get_internal_word, @ins.next(2).method.name
end
def test_receiver_move
assert_equal SlottedMessage, @ins.next.receiver.class
end
end
class TestSendSelfImplicitSlotMachine < TestSendSelfSlotMachine
2018-04-26 19:26:42 +02:00
def send_method
"get_internal_word(0)"
end
end
end