summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-27 15:16:15 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-27 15:32:03 +0900
commit097554855c1a9404f3220bcc5c1906cc62399b59 (patch)
treea3c24f5c61cda63d8ec9b38764005cf962dd1976 /test/ripper
parent2a56702eeea5a571eaa2af15967c6535395e83a2 (diff)
Fix ripper fatal
* parse.y (parser_yylex): return END_OF_INPUT at unterminated here document instead of an error. [Bug #15962]
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index eb423b397e..cc3e208d41 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -489,6 +489,9 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_match("can't find string \"a\" anywhere before EOF", compile_error("<<a"))
assert_match("can't find string \"a\" anywhere before EOF", compile_error('<<"a"'))
assert_match("can't find string \"a\" anywhere before EOF", compile_error("<<'a'"))
+ msg = nil
+ parse('<<"', :on_parse_error) {|_, e| msg = e}
+ assert_equal("unterminated here document identifier", msg)
end
def test_massign