Booting functions again and send test
both class and normal sending tests at vool / mom level
This commit is contained in:
@ -4,27 +4,29 @@ module Vool
|
||||
# relies on @ins and receiver_type method
|
||||
module SimpleSendHarness
|
||||
include VoolCompile
|
||||
include Mom
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
#Risc::Builtin.boot_functions
|
||||
@ins = compile_first_method( send_method )
|
||||
Risc::Builtin.boot_functions
|
||||
@compiler = compile_first_method( send_method )
|
||||
@ins = @compiler.mom_instructions.next
|
||||
end
|
||||
|
||||
def test_first_not_array
|
||||
assert Array != @ins.class , @ins
|
||||
end
|
||||
def test_class_compiles
|
||||
assert_equal Mom::MessageSetup , @ins.class , @ins
|
||||
assert_equal MessageSetup , @ins.class , @ins
|
||||
end
|
||||
def test_two_instructions_are_returned
|
||||
assert_equal 3 , @ins.length , @ins
|
||||
assert_equal 6 , @ins.length , @ins
|
||||
end
|
||||
def test_receiver_move_class
|
||||
assert_equal Mom::ArgumentTransfer, @ins.next(1).class
|
||||
assert_equal ArgumentTransfer, @ins.next(1).class
|
||||
end
|
||||
def test_receiver_move
|
||||
assert_equal Mom::SlotDefinition, @ins.next.receiver.class
|
||||
assert_equal SlotDefinition, @ins.next.receiver.class
|
||||
end
|
||||
def test_receiver
|
||||
type , value = receiver
|
||||
@ -32,13 +34,14 @@ module Vool
|
||||
assert_equal value, @ins.next.receiver.known_object.value
|
||||
end
|
||||
def test_call_is
|
||||
assert_equal Mom::SimpleCall, @ins.next(2).class
|
||||
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_array
|
||||
check_array [Mom::MessageSetup,Mom::ArgumentTransfer,Mom::SimpleCall] , @ins
|
||||
check_array [MessageSetup,ArgumentTransfer,SimpleCall,Label, ReturnSequence ,
|
||||
Label] , @ins
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user