From 6ae1c596f0b179f1b1b2b115ca75eab1631230fe Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 18 May 2019 09:40:52 +0900 Subject: Add test for UNTIL --- test/ruby/test_ast.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 7809be0994..e782653755 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -290,4 +290,16 @@ class TestAst < Test::Unit::TestCase type2 = body.children[2] assert_not_equal(type1, type2) end + + def test_until + node = RubyVM::AbstractSyntaxTree.parse('1 until 1') + _, _, body = *node.children + assert_equal(:UNTIL, body.type) + type1 = body.children[2] + node = RubyVM::AbstractSyntaxTree.parse('begin 1 end until 1') + _, _, body = *node.children + assert_equal(:UNTIL, body.type) + type2 = body.children[2] + assert_not_equal(type1, type2) + end end -- cgit v1.2.3