ruby-changes:51364
From: yui-knk <ko1@a...>
Date: Tue, 5 Jun 2018 09:48:16 +0900 (JST)
Subject: [ruby-changes:51364] yui-knk:r63570 (trunk): test_ast.rb: Add test cases of heredoc columns
yui-knk 2018-06-05 09:48:12 +0900 (Tue, 05 Jun 2018) New Revision: 63570 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63570 Log: test_ast.rb: Add test cases of heredoc columns Modified files: trunk/test/ruby/test_ast.rb Index: test/ruby/test_ast.rb =================================================================== --- test/ruby/test_ast.rb (revision 63569) +++ test/ruby/test_ast.rb (revision 63570) @@ -138,4 +138,16 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L138 assert_equal("NODE_STR", node.type) assert_equal(0, node.first_column) end + + def test_column_of_heredoc + node = RubyVM::AST.parse("<<-SRC\nddddddd\nSRC\n").children[1] + assert_equal("NODE_STR", node.type) + assert_equal(0, node.first_column) + assert_equal(6, node.last_column) + + node = RubyVM::AST.parse("<<SRC\nddddddd\nSRC\n").children[1] + assert_equal("NODE_STR", node.type) + assert_equal(0, node.first_column) + assert_equal(5, node.last_column) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/