diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-15 12:58:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-15 12:58:59 +0000 |
commit | 25daea49d150671b8ee1d017178e553c4c0664fe (patch) | |
tree | 093b660451676e23f0c6d87b629d9e67d1824756 /test | |
parent | 206c0c29ca4b3653da0bc879f881947b1b820a0e (diff) | |
download | ruby-25daea49d150671b8ee1d017178e553c4c0664fe.tar.gz |
parse.y: newline in heredoc identifier
* parse.y (parser_heredoc_identifier): warn newline in here
document identifier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 ad1f0d8981..4c4e840e5e 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -745,6 +745,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_newline + assert_warn(/contains newline/) do + eval("<<\"EOS\n\"\nEOS\n") + end + end + def test__END___cr assert_syntax_error("__END__\r<<<<<\n", /unexpected <</) end |