diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 4e52bc4a72..6fdca37924 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -901,6 +901,12 @@ eom assert_syntax_error("puts <<""EOS\n""ng\n""EOS\r""NO\n", /can't find string "EOS" anywhere before EOF/) end + def test_heredoc_no_terminator + assert_syntax_error("puts <<""A\n", /can't find string "A" anywhere before EOF/) + assert_syntax_error("puts <<""A + <<""B\n", /can't find string "A" anywhere before EOF/) + assert_syntax_error("puts <<""A + <<""B\n", /can't find string "B" anywhere before EOF/) + end + def test_unterminated_heredoc assert_syntax_error("<<\"EOS\n\nEOS\n", /unterminated/) assert_syntax_error("<<\"EOS\n\"\nEOS\n", /unterminated/) |