aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 06:59:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 06:59:57 +0000
commitc48b4209c267299f52ad51b0e8d639679999465a (patch)
tree0eccd86184fdd6bebf2bb47fd26dd9e2d4646413 /test/ruby/test_syntax.rb
parent9af743fe0e8c7aa7a25a6805a64d499aab3032af (diff)
downloadruby-c48b4209c267299f52ad51b0e8d639679999465a.tar.gz
parse.y: CR in middle
* parse.y (parser_whole_match_p): treat CR in middle of a line as a mere whitespace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 99470691ef..f5ff8a7810 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -377,6 +377,14 @@ eom
EOS
end
+ def test_heredoc_cr
+ assert_syntax_error("puts <<""EOS\n""ng\n""EOS\r""NO\n", /can't find string "EOS" anywhere before EOF/)
+ end
+
+ def test__END___cr
+ assert_syntax_error("__END__\r<<<<<\n", /unexpected <</)
+ end
+
private
def not_label(x) @result = x; @not_label ||= nil end