mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add test for UNTIL
This commit is contained in:
parent
4d9c3a8c23
commit
6ae1c596f0
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue