rubyx/test/mom/test_assignment.rb

27 lines
575 B
Ruby
Raw Normal View History

2017-04-10 15:12:15 +02:00
require_relative "helper"
module Mom
class TestAssignemnt < MiniTest::Test
2017-09-10 11:36:16 +02:00
include MomCompile
2017-04-10 15:12:15 +02:00
def setup
Risc.machine.boot
2017-09-10 11:36:16 +02:00
@stats = compile_first_method_flat( "@a = 5")
2017-04-10 15:12:15 +02:00
end
2017-09-10 11:36:16 +02:00
def test_if_compiles
assert_equal SlotConstant , @stats.class , @stats
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
2017-04-10 15:12:15 +02:00
end
end