ruby-changes:51493
From: yui-knk <ko1@a...>
Date: Wed, 20 Jun 2018 21:11:33 +0900 (JST)
Subject: [ruby-changes:51493] yui-knk:r63703 (trunk): test_ast.rb: Fix an argument of `grep`, child is a `RubyVM::AST::Node`
yui-knk 2018-06-20 21:11:25 +0900 (Wed, 20 Jun 2018) New Revision: 63703 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63703 Log: test_ast.rb: Fix an argument of `grep`, child is a `RubyVM::AST::Node` Yusuke Endoh pointed out coverage of ast module is very low. Thanks! Modified files: trunk/test/ruby/test_ast.rb Index: test/ruby/test_ast.rb =================================================================== --- test/ruby/test_ast.rb (revision 63702) +++ test/ruby/test_ast.rb (revision 63703) @@ -72,7 +72,7 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L72 def validate_range0(node) beg_pos, end_pos = node.beg_pos, node.end_pos - children = node.children.grep(RubyVM::AST) + children = node.children.grep(RubyVM::AST::Node) return true if children.empty? # These NODE_D* has NODE_ARRAY as nd_next->nd_next whose last locations @@ -100,7 +100,7 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L100 def validate_not_cared0(node) beg_pos, end_pos = node.beg_pos, node.end_pos - children = node.children.grep(RubyVM::AST) + children = node.children.grep(RubyVM::AST::Node) @errors << { type: :first_lineno, node: node } if beg_pos.lineno == 0 @errors << { type: :first_column, node: node } if beg_pos.column == -1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/