rubyx/test/vool/statements/test_ivar.rb

27 lines
570 B
Ruby
Raw Normal View History

require_relative "helper"
2017-04-02 11:59:07 +02:00
module Vool
class TestAssignment < MiniTest::Test
def test_local
lst = RubyCompiler.compile( "foo = bar")
2017-04-02 11:59:07 +02:00
assert_equal LocalAssignment , lst.class
end
def test_local_name
lst = RubyCompiler.compile( "foo = bar")
2017-04-02 11:59:07 +02:00
assert_equal :foo , lst.name
end
2017-04-04 17:10:28 +02:00
def test_instance
lst = RubyCompiler.compile( "@foo = bar")
assert_equal IvarAssignment , lst.class
2017-04-04 17:10:28 +02:00
end
def test_instance_name
lst = RubyCompiler.compile( "@foo = bar")
2017-04-04 17:10:28 +02:00
assert_equal :foo , lst.name
end
2017-04-02 11:59:07 +02:00
end
end