rubyx/test/ruby/test_yield_statement.rb

19 lines
366 B
Ruby
Raw Normal View History

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