1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Added AST assertions for method definition arguments [Bug #17495]

This commit is contained in:
Nobuyoshi Nakada 2021-01-01 14:44:19 +09:00
parent 1e51027763
commit ab32e98f98
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -253,6 +253,8 @@ class TestAst < Test::Unit::TestCase
mid, defn = body.children
assert_equal(:a, mid)
assert_equal(:SCOPE, defn.type)
_, args, = defn.children
assert_equal(:ARGS, args.type)
end
def test_defn_endless
@ -262,6 +264,8 @@ class TestAst < Test::Unit::TestCase
mid, defn = body.children
assert_equal(:a, mid)
assert_equal(:SCOPE, defn.type)
_, args, = defn.children
assert_equal(:ARGS, args.type)
end
def test_defs
@ -272,6 +276,8 @@ class TestAst < Test::Unit::TestCase
assert_equal(:VCALL, recv.type)
assert_equal(:b, mid)
assert_equal(:SCOPE, defn.type)
_, args, = defn.children
assert_equal(:ARGS, args.type)
end
def test_defs_endless
@ -282,6 +288,8 @@ class TestAst < Test::Unit::TestCase
assert_equal(:VCALL, recv.type)
assert_equal(:b, mid)
assert_equal(:SCOPE, defn.type)
_, args, = defn.children
assert_equal(:ARGS, args.type)
end
def test_dstr