Torsten Rüger
d1f8733623
Simple is really the descriptive name for the layer Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified) Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else Just cause i was renaming anyway
47 lines
1.3 KiB
Ruby
47 lines
1.3 KiB
Ruby
require_relative "../helper"
|
|
|
|
module Sol
|
|
# relies on @ins and receiver_type method
|
|
module SimpleSendHarness
|
|
include SolCompile
|
|
include SlotMachine
|
|
|
|
def setup
|
|
@compiler = compile_main( send_method , "Integer.div4;Object.get")
|
|
@ins = @compiler.slot_instructions.next
|
|
end
|
|
|
|
def test_first_not_array
|
|
assert Array != @ins.class , @ins
|
|
end
|
|
def test_class_compiles
|
|
assert_equal MessageSetup , @ins.class , @ins
|
|
end
|
|
def test_two_instructions_are_returned
|
|
assert_equal 8 , @ins.length , @ins
|
|
end
|
|
def test_receiver_move_class
|
|
assert_equal ArgumentTransfer, @ins.next(1).class
|
|
end
|
|
def test_receiver_move
|
|
assert_equal SlotDefinition, @ins.next.receiver.class
|
|
end
|
|
def test_receiver
|
|
type , value = receiver
|
|
assert_equal type, @ins.next.receiver.known_object.class
|
|
assert_equal value, @ins.next.receiver.known_object.value
|
|
end
|
|
def test_call_is
|
|
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 [MessageSetup,ArgumentTransfer,SimpleCall,
|
|
SlotLoad, ReturnJump, Label, ReturnSequence ,
|
|
Label] , @ins
|
|
end
|
|
end
|
|
end
|