Change Mom to SlotMachine

rather large commit, but essentially a simple rename
Rationale in docs and blogs
This commit is contained in:
2019-10-03 20:55:41 +03:00
parent fd8a3e9cc5
commit c43436f35a
170 changed files with 481 additions and 480 deletions

View File

@ -1,14 +1,14 @@
require_relative "../helper"
module VoolBlocks
class TestAssignMom < MiniTest::Test
class TestAssignSlotMachine < MiniTest::Test
include VoolCompile
def setup
@ins = compile_main_block( "local = 5" )
end
def test_block_compiles
assert_equal Mom::SlotLoad , @ins.class , @ins
assert_equal SlotMachine::SlotLoad , @ins.class , @ins
end
def test_slot_is_set
assert @ins.left
@ -23,17 +23,17 @@ module VoolBlocks
assert @ins.right
end
def test_slot_assigns_int
assert_equal Mom::IntegerConstant , @ins.right.known_object.class
assert_equal SlotMachine::IntegerConstant , @ins.right.known_object.class
end
end
class TestAssignMomInstanceToLocal < MiniTest::Test
class TestAssignSlotMachineInstanceToLocal < MiniTest::Test
include VoolCompile
def setup
@ins = compile_main_block( "local = @a" , "@a = 5") #second arg in method scope
end
def test_class_compiles
assert_equal Mom::SlotLoad , @ins.class , @ins
assert_equal SlotMachine::SlotLoad , @ins.class , @ins
end
def test_slots_left
assert_equal [:local1] , @ins.left.slots
@ -51,7 +51,7 @@ module VoolBlocks
end
def test_class_compiles
assert_equal Mom::SlotLoad , @ins.class , @ins
assert_equal SlotMachine::SlotLoad , @ins.class , @ins
end
def test_slot_is_set
assert @ins.left
@ -61,19 +61,19 @@ module VoolBlocks
end
end
class TestAssignMomToInstance < MiniTest::Test
class TestAssignSlotMachineToInstance < MiniTest::Test
include VoolCompile
def setup
end
def test_assigns_const
@ins = compile_main_block( "@a = 5")
assert_equal Mom::SlotLoad , @ins.class , @ins
assert_equal Mom::IntegerConstant , @ins.right.known_object.class , @ins
assert_equal SlotMachine::SlotLoad , @ins.class , @ins
assert_equal SlotMachine::IntegerConstant , @ins.right.known_object.class , @ins
end
def test_assigns_move
@ins = compile_main_block( "@a = arg")
assert_equal Mom::SlotLoad , @ins.class , @ins
assert_equal Mom::SlotDefinition , @ins.right.class , @ins
assert_equal SlotMachine::SlotLoad , @ins.class , @ins
assert_equal SlotMachine::SlotDefinition , @ins.right.class , @ins
end
end

View File

@ -1,7 +1,7 @@
require_relative "../helper"
module VoolBlocks
class TestClassAssignMom < MiniTest::Test
class TestClassAssignSlotMachine < MiniTest::Test
def setup
Parfait.boot!(Parfait.default_test_options)
@ -14,7 +14,7 @@ module VoolBlocks
vool = Ruby::RubyCompiler.compile( as_class_method(source) ).to_vool
vool.to_parfait
begin
vool.to_mom(nil)
vool.to_slot(nil)
rescue => err
assert err.message.include?("Blocks") , err.message
end
@ -22,7 +22,7 @@ module VoolBlocks
def test_assign_compiles
vool = Ruby::RubyCompiler.compile( as_class_method("val = 0") ).to_vool
vool.to_parfait
assert_equal Mom::MomCollection , vool.to_mom(nil).class
assert_equal SlotMachine::SlotCollection , vool.to_slot(nil).class
end
end
end

View File

@ -1,7 +1,7 @@
require_relative "helper"
module VoolBlocks
class TestConditionIfMom < MiniTest::Test
class TestConditionIfSlotMachine < MiniTest::Test
include VoolCompile
def setup

View File

@ -1,7 +1,7 @@
require_relative "helper"
module VoolBlocks
class TestSimpleWhileMom < MiniTest::Test
class TestSimpleWhileSlotMachine < MiniTest::Test
include VoolCompile
def setup