summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-11 12:19:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-11 12:19:08 +0000
commitf2b094a522717be65a65f478159e6a3166b8651c (patch)
treed5c71968dd2915b27367509bb7f8c6aff6df58a4 /test
parente1a60b2db97eb629661df2227a1f8f06f1afd6d2 (diff)
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/trunk@62724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 7f42bd5965..81737d5103 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__, <<eom, __LINE__