mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3483 from ksss/string-index
String#index shouldn't return nil when "".index ""
This commit is contained in:
@@ -402,6 +402,8 @@ assert('String#index', '15.2.10.5.22') do
|
||||
assert_equal 0, 'abc'.index('a')
|
||||
assert_nil 'abc'.index('d')
|
||||
assert_equal 3, 'abcabc'.index('a', 1)
|
||||
assert_equal 5, "hello".index("", 5)
|
||||
assert_equal nil, "hello".index("", 6)
|
||||
end
|
||||
|
||||
assert('String#initialize', '15.2.10.5.23') do
|
||||
|
||||
Reference in New Issue
Block a user