rubyx/test/vool/send/test_send_args_send.rb
Torsten Rüger 4bf23defc8 fix many tests with preloading
preloading, something akin to builtin, loads some very small predefined (macro) methods for the tests to work (ie call)
2019-09-12 22:27:26 +03:00

28 lines
784 B
Ruby

require_relative "helper"
module Vool
class TestSendArgsSendMom < MiniTest::Test
include VoolCompile
def setup
@compiler = compile_main( "a = main(4.div4);return a" , "Integer.div4")
@ins = @compiler.mom_instructions.next
end
def test_array
check_array [MessageSetup, ArgumentTransfer, SimpleCall, SlotLoad, MessageSetup ,
ArgumentTransfer, SimpleCall, SlotLoad ,SlotLoad, ReturnJump,
Label, ReturnSequence , Label] , @ins
end
def test_one_call
assert_equal SimpleCall, @ins.next(2).class
assert_equal :div4 , @ins.next(2).method.name
end
def test_two_call
assert_equal SimpleCall, @ins.next(6).class
assert_equal :main, @ins.next(6).method.name
end
end
end