Change Mom to SlotMachine
rather large commit, but essentially a simple rename Rationale in docs and blogs
This commit is contained in:
@ -4,11 +4,11 @@ module Vool
|
||||
# relies on @ins and receiver_type method
|
||||
module SimpleSendHarness
|
||||
include VoolCompile
|
||||
include Mom
|
||||
include SlotMachine
|
||||
|
||||
def setup
|
||||
@compiler = compile_main( send_method , "Integer.div4;Object.get")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
@ins = @compiler.slot_instructions.next
|
||||
end
|
||||
|
||||
def test_first_not_array
|
||||
|
@ -1,12 +1,12 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module Vool
|
||||
class TestSendCachedSimpleMom < MiniTest::Test
|
||||
class TestSendCachedSimpleSlotMachine < MiniTest::Test
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_main( "5.div8")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
@ins = @compiler.slot_instructions.next
|
||||
end
|
||||
def test_check_type
|
||||
assert_equal NotSameCheck , @ins.class , @ins
|
||||
|
@ -1,12 +1,12 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestSendArgsSendMom < MiniTest::Test
|
||||
class TestSendArgsSendSlotMachine < MiniTest::Test
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_main( "a = main(4.div4);return a" , "Integer.div4")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
@ins = @compiler.slot_instructions.next
|
||||
end
|
||||
|
||||
def test_array
|
||||
|
@ -1,12 +1,12 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module Vool
|
||||
class TestSendCachedSimpleMom < MiniTest::Test
|
||||
class TestSendCachedSimpleSlotMachine < MiniTest::Test
|
||||
include VoolCompile
|
||||
|
||||
def setup
|
||||
@compiler = compile_main( "a = 5; a.div4;return ")
|
||||
@ins = @compiler.mom_instructions.next
|
||||
@ins = @compiler.slot_instructions.next
|
||||
end
|
||||
def test_check_type
|
||||
assert_equal NotSameCheck , @ins.next(1).class , @ins
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestSendSelfMom < MiniTest::Test
|
||||
class TestSendSelfSlotMachine < MiniTest::Test
|
||||
include SimpleSendHarness
|
||||
|
||||
def send_method
|
||||
@ -23,7 +23,7 @@ module Vool
|
||||
assert_equal :get_internal_word, @ins.next(2).method.name
|
||||
end
|
||||
end
|
||||
class TestSendSelfImplicitMom < TestSendSelfMom
|
||||
class TestSendSelfImplicitSlotMachine < TestSendSelfSlotMachine
|
||||
|
||||
def send_method
|
||||
"get_internal_word(0)"
|
||||
|
@ -1,14 +1,14 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestSendSimpleMom < MiniTest::Test
|
||||
class TestSendSimpleSlotMachine < MiniTest::Test
|
||||
include SimpleSendHarness
|
||||
|
||||
def send_method
|
||||
"5.div4;return"
|
||||
end
|
||||
def receiver
|
||||
[Mom::IntegerConstant , 5]
|
||||
[SlotMachine::IntegerConstant , 5]
|
||||
end
|
||||
def test_call_has_right_method
|
||||
assert_equal :div4, @ins.next(2).method.name
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestSendSimpleArgsMom < MiniTest::Test
|
||||
class TestSendSimpleArgsSlotMachine < MiniTest::Test
|
||||
include SimpleSendHarness
|
||||
|
||||
def send_method
|
||||
@ -9,14 +9,14 @@ module Vool
|
||||
end
|
||||
|
||||
def receiver
|
||||
[Mom::IntegerConstant , 5]
|
||||
[SlotMachine::IntegerConstant , 5]
|
||||
end
|
||||
def test_args_two_move
|
||||
assert_equal :next_message, @ins.next(1).arguments[1].left.slots[0]
|
||||
assert_equal :arg2, @ins.next(1).arguments[1].left.slots[1]
|
||||
end
|
||||
def test_args_two_str
|
||||
assert_equal Mom::IntegerConstant, @ins.next(1).arguments[1].right.known_object.class
|
||||
assert_equal SlotMachine::IntegerConstant, @ins.next(1).arguments[1].right.known_object.class
|
||||
assert_equal 2, @ins.next(1).arguments[1].right.known_object.value
|
||||
end
|
||||
def test_array
|
||||
|
Reference in New Issue
Block a user