diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-03-05 20:27:28 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-03-05 20:27:28 +0900 |
| commit | d050694580e99bc5699da36640d8ce2b4e93c5d0 (patch) | |
| tree | 019001f5d1a3a0185f0f14886f169fbc7e7c9763 /test | |
| parent | 4f43db862a19df01720f72cc91925a497c7d7f45 (diff) | |
| parent | 76e10351faa20301f73a333b13f94a41059baf14 (diff) | |
| download | mruby-d050694580e99bc5699da36640d8ce2b4e93c5d0.tar.gz mruby-d050694580e99bc5699da36640d8ce2b4e93c5d0.zip | |
Merge pull request #3483 from ksss/string-index
String#index shouldn't return nil when "".index ""
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/string.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/t/string.rb b/test/t/string.rb index 20dc49d92..442c95bf7 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -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 |
