rubyx/test/ruby/test_assignment1.rb

34 lines
788 B
Ruby
Raw Normal View History

require_relative "helper"
module Ruby
class TestSolCallMulti2 < MiniTest::Test
include RubyTests
include RubyTests
def setup
@lst = compile( "@foo = a.call(b)").to_sol
2017-09-10 12:04:36 +02:00
end
def test_class
assert_equal Sol::Statements , @lst.class
end
def test_first_class
assert_equal Sol::LocalAssignment , @lst[0].class
end
def test_first_name
assert @lst[0].name.to_s.start_with?("tmp_")
end
def test_second_class
assert_equal Sol::LocalAssignment , @lst[1].class
end
def test_second_name
assert @lst[1].name.to_s.start_with?("tmp_")
end
def test_last_class
assert_equal Sol::IvarAssignment , @lst[2].class
end
def test_second_name
assert_equal :foo, @lst[2].name
2018-03-18 18:08:00 +01:00
end
end
end