2017-04-25 08:40:09 +02:00
|
|
|
require_relative "../helper"
|
2017-09-11 20:30:28 +02:00
|
|
|
require_relative "simple_send_harness"
|
2017-04-25 08:40:09 +02:00
|
|
|
|
|
|
|
module Vool
|
|
|
|
class TestSendSelfMom < MiniTest::Test
|
|
|
|
include MomCompile
|
2017-09-11 20:30:28 +02:00
|
|
|
include SimpleSendHarness
|
2017-04-25 08:40:09 +02:00
|
|
|
|
2017-09-11 13:23:30 +02:00
|
|
|
def do_setup(str)
|
2017-04-25 08:40:09 +02:00
|
|
|
Risc.machine.boot
|
2017-09-11 13:23:30 +02:00
|
|
|
@stats = compile_first_method( str).first
|
|
|
|
@first = @stats.first
|
|
|
|
end
|
|
|
|
def setup
|
|
|
|
do_setup("self.get_internal_word(0)")
|
2017-04-25 08:40:09 +02:00
|
|
|
end
|
|
|
|
|
2017-09-11 20:30:28 +02:00
|
|
|
def test_receiver
|
2017-09-11 13:23:30 +02:00
|
|
|
assert_equal SelfStatement, @stats[1].receiver.right.class
|
2017-04-25 08:40:09 +02:00
|
|
|
end
|
2017-09-11 20:30:28 +02:00
|
|
|
|
2017-04-25 08:40:09 +02:00
|
|
|
def test_arg_one
|
2017-09-11 13:23:30 +02:00
|
|
|
assert_equal Mom::SlotConstant, @stats[1].arguments[0].class
|
2017-04-25 08:40:09 +02:00
|
|
|
end
|
|
|
|
def test_call_two
|
|
|
|
assert_equal Mom::SimpleCall, @stats[2].class
|
|
|
|
end
|
|
|
|
def test_call_has_method
|
|
|
|
assert_equal Parfait::TypedMethod, @stats[2].method.class
|
|
|
|
end
|
|
|
|
def test_call_has_right_method
|
|
|
|
assert_equal :get_internal_word, @stats[2].method.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
class TestSendSelfImplicitMom < TestSendSelfMom
|
|
|
|
|
|
|
|
def setup
|
2017-09-11 13:23:30 +02:00
|
|
|
do_setup( "get_internal_word(0)")
|
2017-04-25 08:40:09 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|