summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-27 15:13:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-27 15:13:45 +0900
commit2a56702eeea5a571eaa2af15967c6535395e83a2 (patch)
tree4a75903a3601838aa453dd4299459b76f0baa1ca /test/ripper/test_parser_events.rb
parentc86a9e6592c2cb37734cf29d81a8f9d26a4340b3 (diff)
Test for unterminated here-docs
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 1d2c501c3b..eb423b397e 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -485,6 +485,12 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal(1, width)
end
+ def test_unterminated_heredoc
+ 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'"))
+ end
+
def test_massign
thru_massign = false
parse("a, b = 1, 2", :on_massign) {thru_massign = true}