ruby-changes:64698
From: Nobuyoshi <ko1@a...>
Date: Fri, 1 Jan 2021 14:50:11 +0900 (JST)
Subject: [ruby-changes:64698] ab32e98f98 (master): Added AST assertions for method definition arguments [Bug #17495]
https://git.ruby-lang.org/ruby.git/commit/?id=ab32e98f98 From ab32e98f984318f1074c6e39b8f2f04266a1224b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 1 Jan 2021 14:44:19 +0900 Subject: Added AST assertions for method definition arguments [Bug #17495] diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 9c218f3..b039911 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -253,6 +253,8 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L253 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L264 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L276 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L288 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/