first send test to work again
This commit is contained in:
parent
3c92e707da
commit
8598257a98
@ -4,32 +4,41 @@ module Vool
|
|||||||
class TestSendSelfMom < MiniTest::Test
|
class TestSendSelfMom < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def do_setup(str)
|
||||||
Risc.machine.boot
|
Risc.machine.boot
|
||||||
@stats = compile_first_method( "self.get_internal_word(0)").first
|
@stats = compile_first_method( str).first
|
||||||
|
@first = @stats.first
|
||||||
|
end
|
||||||
|
def setup
|
||||||
|
do_setup("self.get_internal_word(0)")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_class_compiles
|
def test_compiles
|
||||||
assert_equal Mom::SlotMove , @stats.first.class , @stats
|
assert_equal Mom::Statements , @stats.class , @stats
|
||||||
end
|
end
|
||||||
def test_slot_is_set
|
def test_compile_starts_with_setup
|
||||||
assert @stats.first.left
|
assert_equal Mom::MessageSetup , @stats[0].class , @stats
|
||||||
end
|
end
|
||||||
def test_two_instructions_are_returned
|
def test_compile_continues_with_transfer
|
||||||
|
assert_equal Mom::ArgumentTransfer , @stats[1].class , @stats
|
||||||
|
end
|
||||||
|
def test_method_is_set
|
||||||
|
assert @first.method
|
||||||
|
end
|
||||||
|
def test_three_instructions_are_returned
|
||||||
assert_equal 3 , @stats.length
|
assert_equal 3 , @stats.length
|
||||||
end
|
end
|
||||||
def test_receiver_move_class
|
def test_arg_transfers
|
||||||
assert_equal Mom::SlotMove, @stats.first.class
|
assert_equal Mom::ArgumentTransfer, @stats[1].class
|
||||||
end
|
end
|
||||||
def test_receiver_move
|
def test_receiver_move
|
||||||
assert_equal :receiver, @stats.first.left[2]
|
assert_equal Mom::SlotMove, @stats[1].receiver.class
|
||||||
end
|
end
|
||||||
def test_receiver
|
def test_receiver_self
|
||||||
assert_equal SelfStatement, @stats.first.right.class
|
assert_equal SelfStatement, @stats[1].receiver.right.class
|
||||||
assert_equal :Test, @stats.first.right.clazz.name
|
|
||||||
end
|
end
|
||||||
def test_arg_one
|
def test_arg_one
|
||||||
assert_equal Mom::SlotConstant, @stats[1].class
|
assert_equal Mom::SlotConstant, @stats[1].arguments[0].class
|
||||||
end
|
end
|
||||||
def test_call_two
|
def test_call_two
|
||||||
assert_equal Mom::SimpleCall, @stats[2].class
|
assert_equal Mom::SimpleCall, @stats[2].class
|
||||||
@ -44,8 +53,7 @@ module Vool
|
|||||||
class TestSendSelfImplicitMom < TestSendSelfMom
|
class TestSendSelfImplicitMom < TestSendSelfMom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Risc.machine.boot
|
do_setup( "get_internal_word(0)")
|
||||||
@stats = compile_first_method( "get_internal_word(0)").first
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user