From afa685398e6c098a55bb2d0565e8f1bd380e4ab9 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 3 Dec 2018 01:06:34 +0000 Subject: Refine RubyVM::AbstractSyntaxTree::Node#type * ast.c (rb_ast_node_type): simplified to return a Symbol without "NODE_" prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_ast.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'test/ruby/test_ast.rb') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 31744e9215..055567d574 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -76,7 +76,7 @@ class TestAst < Test::Unit::TestCase return true if children.empty? # These NODE_D* has NODE_ARRAY as nd_next->nd_next whose last locations # we can not update when item is appended. - return true if ["NODE_DSTR", "NODE_DXSTR", "NODE_DREGX", "NODE_DSYM"].include? node.type + return true if [:DSTR, :DXSTR, :DREGX, :DSYM].include? node.type min = children.map(&:beg_pos).min max = children.map(&:end_pos).max @@ -138,18 +138,18 @@ class TestAst < Test::Unit::TestCase term = "A"*257 ast = RubyVM::AbstractSyntaxTree.parse("<<-#{term}\n""ddddddd\n#{term}\n") node = ast.children[2] - assert_equal("NODE_STR", node.type) + assert_equal(:STR, node.type) assert_equal(0, node.first_column) end def test_column_of_heredoc node = RubyVM::AbstractSyntaxTree.parse("<<-SRC\nddddddd\nSRC\n").children[2] - assert_equal("NODE_STR", node.type) + assert_equal(:STR, node.type) assert_equal(0, node.first_column) assert_equal(6, node.last_column) node = RubyVM::AbstractSyntaxTree.parse("<