rubyx/test/ruby/test_yield_statement.rb
Torsten Ruger d73e1526cd Some docs and to_s testing
somewhat code_climate inspired
2018-09-01 15:54:25 +03:00

36 lines
778 B
Ruby

require_relative "helper"
module Ruby
class TestYieldStatementVool < MiniTest::Test
include RubyTests
def setup()
input = "yield(0)"
@lst = compile( input ).to_vool
end
def test_block
assert_equal Vool::YieldStatement , @lst.class
end
def test_block_args
assert_equal Vool::IntegerConstant , @lst.arguments.first.class
end
end
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
end