summaryrefslogtreecommitdiff
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
authorSoutaro Matsumoto <matsumoto@soutaro.com>2020-09-11 14:34:10 +0900
committerGitHub <noreply@github.com>2020-09-11 14:34:10 +0900
commitf0ddbd502c1d6912cec9a91997966ba659e347c1 (patch)
treebabd8255e60b285492ffb440e6fa22755b64de69 /test/ruby/test_string.rb
parent0d78390bfb9d87ac7ee192115216882e09c50a06 (diff)
Let String#slice! return nil (#3533)
Returns `nil` instead of an empty string when non-integer number is given (to make it 2.7 compatible).
Notes
Notes: Merged-By: soutaro <matsumoto@soutaro.com>
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index b2f0289b18..fde1c9cdc5 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1588,8 +1588,10 @@ CODE
a = S("FooBar")
if @aref_slicebang_silent
assert_nil( a.slice!(6) )
+ assert_nil( a.slice!(6r) )
else
assert_raise(IndexError) { a.slice!(6) }
+ assert_raise(IndexError) { a.slice!(6r) }
end
assert_equal(S("FooBar"), a)