fix mom assignment test
This commit is contained in:
parent
c5ac24c850
commit
a523af14f1
@ -2,15 +2,24 @@ require_relative "helper"
|
|||||||
|
|
||||||
module Mom
|
module Mom
|
||||||
class TestAssignemnt < MiniTest::Test
|
class TestAssignemnt < MiniTest::Test
|
||||||
include CompilerHelper
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Risc.machine.boot
|
Risc.machine.boot
|
||||||
|
@stats = compile_first_method_flat( "@a = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
def compile_first input
|
def test_if_compiles
|
||||||
lst = Vool::VoolCompiler.compile in_Space( input )
|
assert_equal SlotConstant , @stats.class , @stats
|
||||||
lst.to_mom( nil )
|
end
|
||||||
|
def test_length
|
||||||
|
assert_equal 1 , @stats.length
|
||||||
|
end
|
||||||
|
def test_assigns_class
|
||||||
|
assert_equal Vool::IntegerStatement , @stats.right.class , @stats.inspect
|
||||||
|
end
|
||||||
|
def test_assigns_value
|
||||||
|
assert_equal 5 , @stats.right.value , @stats.inspect
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user