From ff6d84a09b227302d97d68bea7433c227635db67 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 15 Mar 2018 20:55:23 +0530 Subject: [PATCH] ivar tests work bit of slot find replace --- test/vool/to_mom/send/test_send_cached_simple.rb | 6 +++--- test/vool/to_mom/send/test_send_self.rb | 2 +- test/vool/to_mom/test_assign.rb | 2 +- test/vool/to_mom/test_if_condition.rb | 2 +- test/vool/to_mom/test_if_simple.rb | 2 +- test/vool/to_mom/test_ivar.rb | 16 ++++++++-------- test/vool/to_mom/test_local.rb | 2 +- test/vool/to_mom/test_return.rb | 2 +- test/vool/to_mom/test_while_condition.rb | 2 +- test/vool/to_mom/test_while_simple.rb | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/vool/to_mom/send/test_send_cached_simple.rb b/test/vool/to_mom/send/test_send_cached_simple.rb index dee89e5f..00b4e986 100644 --- a/test/vool/to_mom/send/test_send_cached_simple.rb +++ b/test/vool/to_mom/send/test_send_cached_simple.rb @@ -23,7 +23,7 @@ module Vool assert_equal Mom::NotSameCheck , @first.condition.class , @first end def test_if_true_moves_type - assert_equal @first.if_true[0].class, Mom::SlotMove , @first.if_true.to_rxf + assert_equal @first.if_true[0].class, Mom::SlotLoad , @first.if_true.to_rxf end def test_if_true_resolves_setup assert_equal @first.if_true[1].class , Mom::MessageSetup, @first.if_true.to_rxf @@ -35,7 +35,7 @@ module Vool assert_equal @first.if_true[3].class , Mom::SimpleCall, @first.if_true.to_rxf end def test_if_true_resolves_move - assert_equal @first.if_true[4].class , Mom::SlotMove, @first.if_true.to_rxf + assert_equal @first.if_true[4].class , Mom::SlotLoad, @first.if_true.to_rxf end def test_setup_second @@ -51,7 +51,7 @@ module Vool end def test_array - check_array [SlotConstant,NotSameCheck,Label,SlotMove,MessageSetup,ArgumentTransfer,SimpleCall,SlotMove,Label,MessageSetup,ArgumentTransfer,DynamicCall] , @stats + check_array [SlotLoad,NotSameCheck,Label,SlotLoad,MessageSetup,ArgumentTransfer,SimpleCall,SlotLoad,Label,MessageSetup,ArgumentTransfer,DynamicCall] , @stats end end diff --git a/test/vool/to_mom/send/test_send_self.rb b/test/vool/to_mom/send/test_send_self.rb index 480f93c7..b1529d2d 100644 --- a/test/vool/to_mom/send/test_send_self.rb +++ b/test/vool/to_mom/send/test_send_self.rb @@ -20,7 +20,7 @@ module Vool end def test_arg_one - assert_equal Mom::SlotConstant, @stats[1].arguments[0].class + assert_equal Mom::SlotLoad, @stats[1].arguments[0].class end def test_call_two assert_equal Mom::SimpleCall, @stats[2].class diff --git a/test/vool/to_mom/test_assign.rb b/test/vool/to_mom/test_assign.rb index 42be2071..0dac0368 100644 --- a/test/vool/to_mom/test_assign.rb +++ b/test/vool/to_mom/test_assign.rb @@ -32,7 +32,7 @@ module Vool end end - #otherwise as above, but assigning instance, so should get a SlotMove + #otherwise as above, but assigning instance, so should get a SlotLoad class TestAssignMomInstanceToLocal < MiniTest::Test include MomCompile def setup diff --git a/test/vool/to_mom/test_if_condition.rb b/test/vool/to_mom/test_if_condition.rb index 66e06d25..e91bd460 100644 --- a/test/vool/to_mom/test_if_condition.rb +++ b/test/vool/to_mom/test_if_condition.rb @@ -21,7 +21,7 @@ module Vool assert_equal Mom::SlotDefinition , @first.condition.condition.class , @stats end def test_hoisetd - assert_equal Mom::SlotMove , @first.hoisted.class + assert_equal Mom::SlotLoad , @first.hoisted.class end end end diff --git a/test/vool/to_mom/test_if_simple.rb b/test/vool/to_mom/test_if_simple.rb index 803569d2..e8e7b2bb 100644 --- a/test/vool/to_mom/test_if_simple.rb +++ b/test/vool/to_mom/test_if_simple.rb @@ -27,7 +27,7 @@ module Vool assert_nil @first.hoisted , @stats end def test_array - check_array [SlotMove,TruthCheck,Label,MessageSetup,ArgumentTransfer,SimpleCall,Label], @stats + check_array [SlotLoad,TruthCheck,Label,MessageSetup,ArgumentTransfer,SimpleCall,Label], @stats end end end diff --git a/test/vool/to_mom/test_ivar.rb b/test/vool/to_mom/test_ivar.rb index e7fad65a..95e817ea 100644 --- a/test/vool/to_mom/test_ivar.rb +++ b/test/vool/to_mom/test_ivar.rb @@ -6,32 +6,32 @@ module Vool def setup Risc.machine.boot - @method = compile_first_method( "@a = 5") + @ins = compile_first_method( "@a = 5") end def test_compiles_not_array assert Array != @stats.class , @stats end def test_class_compiles - assert_equal Mom::SlotConstant , @method.first.class , @method + assert_equal Mom::SlotLoad , @ins.class , @ins end def test_slot_is_set - assert @method.first.left + assert @ins.left end def test_slot_starts_at_message - assert_equal :message , @method.first.left.known_object + assert_equal :message , @ins.left.known_object end def test_slot_gets_self - assert_equal :receiver , @method.first.left.slots[0] + assert_equal :receiver , @ins.left.slots[0] end def test_slot_assigns_to_local - assert_equal :a , @method.first.left.slots[-1] + assert_equal :a , @ins.left.slots[-1] end def test_slot_assigns_something - assert @method.first.right + assert @ins.right end def test_slot_assigns_int - assert_equal Mom::IntegerConstant , @method.first.right.class + assert_equal Mom::IntegerConstant , @ins.right.class end end end diff --git a/test/vool/to_mom/test_local.rb b/test/vool/to_mom/test_local.rb index 047dc37f..c17b9b9b 100644 --- a/test/vool/to_mom/test_local.rb +++ b/test/vool/to_mom/test_local.rb @@ -14,7 +14,7 @@ module Vool assert Array != @stats.class , @stats end def test_class_compiles - assert_equal Mom::SlotConstant , @first.class , @stats + assert_equal Mom::SlotLoad , @first.class , @stats end def test_slot_is_set assert @first.left diff --git a/test/vool/to_mom/test_return.rb b/test/vool/to_mom/test_return.rb index 95eb315b..4ad36863 100644 --- a/test/vool/to_mom/test_return.rb +++ b/test/vool/to_mom/test_return.rb @@ -13,7 +13,7 @@ module Vool assert Array != @stats.class , @stats end def test_class_compiles - assert_equal Mom::SlotConstant , @stats.first.class , @stats + assert_equal Mom::SlotLoad , @stats.first.class , @stats end def test_slot_is_set assert @stats.first.left diff --git a/test/vool/to_mom/test_while_condition.rb b/test/vool/to_mom/test_while_condition.rb index aded5477..bb2a72a9 100644 --- a/test/vool/to_mom/test_while_condition.rb +++ b/test/vool/to_mom/test_while_condition.rb @@ -21,7 +21,7 @@ module Vool assert_equal Mom::SlotDefinition , @first.condition.condition.class , @stats end def test_hoisetd - assert_equal Mom::SlotMove , @first.hoisted.class + assert_equal Mom::SlotLoad , @first.hoisted.class end end end diff --git a/test/vool/to_mom/test_while_simple.rb b/test/vool/to_mom/test_while_simple.rb index 978cf48a..45de6eba 100644 --- a/test/vool/to_mom/test_while_simple.rb +++ b/test/vool/to_mom/test_while_simple.rb @@ -27,7 +27,7 @@ module Vool assert_nil @first.hoisted , @stats end def test_array - check_array [Label,SlotMove,TruthCheck,Label] , @stats + check_array [Label,SlotLoad,TruthCheck,Label] , @stats end end end