summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-28 09:29:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-28 09:29:24 +0900
commitace2eee544378eb03ea95b95c89434508325e8c8 (patch)
treec669df863a6a1f2af18c3c0b61dab68bdd436271 /test/ripper
parent111b69e8a009f469356a723183b651626dbaa8c4 (diff)
downloadruby-ace2eee544378eb03ea95b95c89434508325e8c8.tar.gz
[Bug #18963] Separate string contents by here document terminator
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_lexer.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb
index 4f3f4657ef..27e0007023 100644
--- a/test/ripper/test_lexer.rb
+++ b/test/ripper/test_lexer.rb
@@ -242,4 +242,14 @@ class TestRipper::Lexer < Test::Unit::TestCase
EOF
assert_equal([[5, 0], :on_heredoc_end, "EOS\n", state(:EXPR_BEG)], Ripper.lex(s).last, bug)
end
+
+ def test_tokenize_with_here_document
+ bug = '[Bug #18963]'
+ code = %[
+<<A + "hello
+A
+world"
+]
+ assert_equal(code, Ripper.tokenize(code).join(""), bug)
+ end
end