summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 66adeb1c09..771764720b 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -857,6 +857,12 @@ eom
assert_syntax_error("<<\"EOS\n\"\nEOS\n", /unterminated/)
end
+ def test_unterminated_heredoc_cr
+ %W[\r\n \n].each do |nl|
+ assert_syntax_error("<<\"\r\"#{nl}\r#{nl}", /unterminated/, nil, "CR with #{nl.inspect}")
+ end
+ end
+
def test__END___cr
assert_syntax_error("__END__\r<<<<<\n", /unexpected <</)
end