summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-18 15:29:37 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-18 15:29:37 +0000
commit091f98cf8c34c4288d0a3afcddd566ab652a30fb (patch)
tree143c36ff8c569f7606a9c46039574ee299a52510 /test
parentca310ba6f7a37d43ab977429081747bed44816e5 (diff)
merge revision(s) 53573: [Backport #11989]
* parse.y (parser_here_document): an escaped newline is not an actual newline, and the rest part should not be dedented. [ruby-core:72855] [Bug #11989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 29851b79de..91594c013a 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -612,6 +612,15 @@ e"
assert_dedented_heredoc(expect, result)
end
+ def test_dedented_heredoc_with_newline
+ bug11989 = '[ruby-core:72855] [Bug #11989] after escaped newline should not be dedented'
+ result = ' x\n'" y\n" \
+ " z\n"
+ expect = 'x\n'" y\n" \
+ "z\n"
+ assert_dedented_heredoc(expect, result, bug11989)
+ end
+
def test_dedented_heredoc_with_concatenation
bug11990 = '[ruby-core:72857] [Bug #11990] concatenated string should not be dedented'
%w[eos "eos" 'eos'].each do |eos|