summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-19 01:35:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-19 01:35:21 +0900
commit67dd52d59cde0d2f1ebb3e299b605ed239b59f5b (patch)
tree6cc6d456897018157e6d5ec256f16885dfa6a118 /test/ruby
parente8e7ff1333b9b32d72a1d8f789a186d58c811420 (diff)
[Bug #19539] Match heredoc identifier from end of line
Not to ignore leading spaces in indented heredoc identifier.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7566
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_parse.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 2f2c062ceb..49b25fcaf0 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -681,6 +681,16 @@ FOO
eval "x = <<""FOO\r\n1\r\nFOO"
end
assert_equal("1\n", x)
+
+ assert_nothing_raised do
+ x = eval "<<' FOO'\n""[Bug #19539]\n"" FOO\n"
+ end
+ assert_equal("[Bug #19539]\n", x)
+
+ assert_nothing_raised do
+ x = eval "<<-' FOO'\n""[Bug #19539]\n"" FOO\n"
+ end
+ assert_equal("[Bug #19539]\n", x)
end
def test_magic_comment