diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-03-02 18:28:30 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-03-02 18:28:30 +0900 |
commit | a6dec2e144d65011d49f272e494bf62daf3d7531 (patch) | |
tree | 0f052b46504174ad733f40c9da78a711f2764b04 /test | |
parent | 713d6d5eb05de06a0de25feef801ff8c72c65754 (diff) |
merge revision(s) 5de38c41ae7bf17ae599fdfa9f8face87f16d8bb: [Backport #17644]
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug
#17644]
---
ext/ripper/lib/ripper/lexer.rb | 2 +-
test/ripper/test_lexer.rb | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/ripper/test_lexer.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb index 3eaeb8fefa..975976a381 100644 --- a/test/ripper/test_lexer.rb +++ b/test/ripper/test_lexer.rb @@ -215,4 +215,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 |