summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-04 14:41:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-04 14:41:52 +0900
commit9cdc964d075fc3d21b8ce8456ac88f57a5183ec0 (patch)
tree17437f09c0e18fdaa7d43f3bbc0ebcc547d2181f /test/ruby/test_syntax.rb
parent7a51d979cf9c98209b7c1b1d54016348e8124904 (diff)
Do not warn CR inside string literal
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 5591b7cb31..f92966fda9 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -949,9 +949,14 @@ eom
def test_warning_for_cr
feature8699 = '[ruby-core:56240] [Feature #8699]'
- assert_warning(/encountered \\r/, feature8699) do
- eval("\r""__id__\r")
+ s = assert_warning(/encountered \\r/, feature8699) do
+ eval("'\r'\r")
end
+ assert_equal("\r", s)
+ s = assert_warning('') do
+ eval("'\r'\r\n")
+ end
+ assert_equal("\r", s)
end
def test_unexpected_fraction