summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShugo Maeda <shugo@ruby-lang.org>2021-02-19 16:38:34 +0900
committerShugo Maeda <shugo@ruby-lang.org>2021-02-19 16:40:29 +0900
commit5de38c41ae7bf17ae599fdfa9f8face87f16d8bb (patch)
tree2c4bb713d9d3cdc1252ad2bb08357d7f56db9b6f /test
parent7b9476fbfab738d1eb01b4b4c4af9a1680513019 (diff)
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644]
Diffstat (limited to 'test')
-rw-r--r--test/ripper/test_lexer.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb
index 79cb194e5b..d0389f7c96 100644
--- a/test/ripper/test_lexer.rb
+++ b/test/ripper/test_lexer.rb
@@ -216,4 +216,16 @@ class TestRipper::Lexer < Test::Unit::TestCase
end
end
end
+
+ def test_lex_with_syntax_error_and_heredo
+ bug = '[Bug #17644]'
+ s = <<~EOF
+ foo
+ end
+ <<~EOS
+ bar
+ EOS
+ EOF
+ assert_equal([[5, 0], :on_heredoc_end, "EOS\n", state(:EXPR_BEG)], Ripper.lex(s).last, bug)
+ end
end