ivar tests work

bit of slot find replace
This commit is contained in:
Torsten Ruger
2018-03-15 20:55:23 +05:30
parent 4a79d20a40
commit ff6d84a09b
10 changed files with 19 additions and 19 deletions

View File

@ -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