improve mom assignment tests
This commit is contained in:
parent
1a9370ad14
commit
94ca8da354
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Mom
|
||||
class TestAssignemnt < MiniTest::Test
|
||||
class TestConstToIvarAssignemnt < MiniTest::Test
|
||||
include MomCompile
|
||||
|
||||
def setup
|
||||
@ -23,4 +23,33 @@ module Mom
|
||||
end
|
||||
|
||||
end
|
||||
class TestConstToLocalAssignemnt < MiniTest::Test
|
||||
include MomCompile
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
@stats = compile_first_method_flat( "a = 5")
|
||||
end
|
||||
def test_if_compiles
|
||||
assert_equal SlotConstant , @stats.class , @stats
|
||||
end
|
||||
def test_length
|
||||
assert_equal 1 , @stats.length
|
||||
end
|
||||
end
|
||||
class TestIvarToLocalAssignemnt < MiniTest::Test
|
||||
include MomCompile
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
@stats = compile_first_method_flat( "a = @a")
|
||||
end
|
||||
def test_if_compiles
|
||||
assert_equal SlotMove , @stats.class , @stats
|
||||
end
|
||||
def test_length
|
||||
assert_equal 1 , @stats.length
|
||||
end
|
||||
def test_assigns_class
|
||||
assert_equal Vool::InstanceVariable , @stats.right.class , @stats.inspect
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user