rubyx/test/vool/test_yield_statement.rb
Torsten Ruger d80ef4bf4e store method, not name, in message
changes the calling and thus too many test
2018-07-22 22:29:32 +03:00

34 lines
905 B
Ruby

require_relative "helper"
module Vool
class TestYieldArgsSendMom #< MiniTest::Test
include MomCompile
include Mom
def setup
Parfait.boot!
@ins = compile_first_method( "yield(1)" )
end
def test_array
check_array [MessageSetup, ArgumentTransfer, SimpleCall, SlotLoad, MessageSetup ,
ArgumentTransfer, SimpleCall, SlotLoad] , @ins
end
def pest_one_call
assert_equal SimpleCall, @ins.next(2).class
assert_equal :+, @ins.next(2).method.name
end
def pest_two_call
assert_equal SimpleCall, @ins.next(6).class
assert_equal :main, @ins.next(6).method.name
end
def pest_args_one_l
left = @ins.next(1).arguments[0].left
assert_equal Symbol, left.known_object.class
assert_equal :message, left.known_object
assert_equal [:next_message, :arguments, 1], left.slots
end
end
end