rubyx/test/ruby/test_block_statement.rb
Torsten Ruger 38350dd198 start a new ruby layer to do the to_vool conversion
the "normalization" is getting more and more complicated and is not tested
And it seems i really don't like working with the untyped ast
2018-07-19 14:46:51 +03:00

31 lines
667 B
Ruby

require_relative "helper"
module Ruby
class TestBlockStatementX < MiniTest::Test
include RubyTests
def setup()
input = "plus_one{|arg1| arg1 + 1 } "
@lst = compile( input )
end
def test_method
assert_equal SendStatement , @lst.class
end
def test_block
assert_equal BlockStatement , @lst.block.class
end
def test_method_name
assert_equal :plus_one , @lst.name
end
def test_block_args
assert_equal [:arg1] , @lst.block.args
end
def test_block_body
assert_equal SendStatement , @lst.block.body.class
assert_equal 1 , @lst.block.body.arguments.length
end
end
end