summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-05-08 19:25:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-05-08 19:25:37 +0900
commit5bb656e4f063e717262efe2dc303ed914eb1dd6c (patch)
treeadeabf59d5c38be6dca435bf5e8b8ff17dc2b924 /test/ruby
parent841b45a4421a7f103b0312f84c14ece522833617 (diff)
[Bug #20474] Keep spaces in leading blank line
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_syntax.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 8bdac2ebd1..7b894eee79 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -889,6 +889,16 @@ e"
assert_dedented_heredoc(expect, result)
end
+ def test_dedented_heredoc_with_leading_blank_line
+ # the blank line has six leading spaces
+ result = " \n" \
+ " b\n"
+ expect = " \n" \
+ "b\n"
+ assert_dedented_heredoc(expect, result)
+ end
+
+
def test_dedented_heredoc_with_blank_more_indented_line_escaped
result = " a\n" \
"\\ \\ \\ \\ \\ \\ \n" \
@@ -996,7 +1006,7 @@ eom
end
def test_dedented_heredoc_concatenation
- assert_equal("\n0\n1", eval("<<~0 '1'\n \n0\#{}\n0"))
+ assert_equal(" \n0\n1", eval("<<~0 '1'\n \n0\#{}\n0"))
end
def test_heredoc_mixed_encoding