summaryrefslogtreecommitdiff
path: root/test/ruby/test_ast.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-18 09:40:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-18 09:41:22 +0900
commit6ae1c596f0b179f1b1b2b115ca75eab1631230fe (patch)
tree9e626db26c06cd24003a04429e4c2eb2dfa533eb /test/ruby/test_ast.rb
parent4d9c3a8c2362b7d5973057435258e447ce733741 (diff)
Add test for UNTIL
Diffstat (limited to 'test/ruby/test_ast.rb')
-rw-r--r--test/ruby/test_ast.rb12
1 files changed, 12 insertions, 0 deletions
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