rubyx/test/ruby/test_yield_statement.rb

36 lines
774 B
Ruby
Raw Normal View History

2018-06-28 19:15:24 +02:00
require_relative "helper"
module Ruby
class TestYieldStatement < MiniTest::Test
include RubyTests
def setup()
input = "yield(0)"
@lst = compile( input )
end
def test_block
assert_equal YieldStatement , @lst.class
end
def test_block_args
assert_equal IntegerConstant , @lst.arguments.first.class
end
def test_tos
assert_equal "yield(0)" , @lst.to_s
end
end
class TestYieldStatementSol < MiniTest::Test
include RubyTests
2018-06-28 19:15:24 +02:00
def setup()
input = "yield(0)"
@lst = compile( input ).to_sol
2018-06-28 19:15:24 +02:00
end
def test_block
assert_equal Sol::YieldStatement , @lst.class
2018-06-28 19:15:24 +02:00
end
def test_block_args
assert_equal Sol::IntegerConstant , @lst.arguments.first.class
end
2018-06-28 19:15:24 +02:00
end
end