diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-27 15:13:45 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-27 15:13:45 +0900 |
commit | 2a56702eeea5a571eaa2af15967c6535395e83a2 (patch) | |
tree | 4a75903a3601838aa453dd4299459b76f0baa1ca /test/ripper | |
parent | c86a9e6592c2cb37734cf29d81a8f9d26a4340b3 (diff) |
Test for unterminated here-docs
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_parser_events.rb | 6 |
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} |