summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-18 00:40:52 (GMT)
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-18 00:41:22 (GMT)
commit6ae1c596f0b179f1b1b2b115ca75eab1631230fe (patch)
tree9e626db26c06cd24003a04429e4c2eb2dfa533eb
parent4d9c3a8c2362b7d5973057435258e447ce733741 (diff)
Add test for UNTIL
-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 7809be0..e7826537 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