summaryrefslogtreecommitdiff
path: root/test/ruby/test_ast.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-01 14:44:19 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-01 14:48:46 +0900
commitab32e98f984318f1074c6e39b8f2f04266a1224b (patch)
treea25b094c4d9b80157e9dcfd5350b0959ec3517b5 /test/ruby/test_ast.rb
parent1e51027763ab2b96e9a1a0aecbe7d42e62d00fc6 (diff)
Added AST assertions for method definition arguments [Bug #17495]
Diffstat (limited to 'test/ruby/test_ast.rb')
-rw-r--r--test/ruby/test_ast.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 9c218f3ad8..b039911f3a 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -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