2017-04-02 18:13:14 +02:00
|
|
|
require_relative "helper"
|
2017-04-02 11:59:07 +02:00
|
|
|
|
|
|
|
module Vool
|
|
|
|
class TestAssignment < MiniTest::Test
|
|
|
|
|
|
|
|
def test_local
|
2017-04-06 14:36:41 +02:00
|
|
|
lst = RubyCompiler.compile( "foo = bar")
|
2017-04-02 11:59:07 +02:00
|
|
|
assert_equal LocalAssignment , lst.class
|
|
|
|
end
|
|
|
|
def test_local_name
|
2017-04-06 14:36:41 +02:00
|
|
|
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
|
2017-04-06 14:36:41 +02:00
|
|
|
lst = RubyCompiler.compile( "@foo = bar")
|
2017-04-04 17:10:28 +02:00
|
|
|
assert_equal InstanceAssignment , lst.class
|
|
|
|
end
|
|
|
|
def test_instance_name
|
2017-04-06 14:36:41 +02:00
|
|
|
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
|