From 2bedc514725bd4ec27e6fdc3aed485badc1a3ec0 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 24 Mar 2018 11:43:50 +0000 Subject: merge revision(s) 62723,62724: [Backport #14584] parse.y: reduce duplicate code parse.y: fix interpolated string literal dedent * parse.y (heredoc_dedent): fix interpolated string literal dedent, remove indentations from only nodes with the newline flag. [ruby-core:85983] [Bug #14584] * parse.y (here_document): set the newline flag on literal string nodes starting at the beginning of line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index aa82f52987..e1a035704e 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -667,6 +667,12 @@ e" assert_dedented_heredoc(expected, result) end + def test_dedented_heredoc_expr_string + result = ' one#{" two "}'"\n" + expected = 'one#{" two "}'"\n" + assert_dedented_heredoc(expected, result) + end + def test_lineno_after_heredoc bug7559 = '[ruby-dev:46737]' expected, _, actual = __LINE__, <