diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-04 22:22:45 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-04 22:22:45 +0900 |
| commit | 47d1701fb4d94c8710c4045372c6aa9dd4f5e909 (patch) | |
| tree | de3f0bb201707dea535381706b645feb7fb708fa /test | |
| parent | a479dafb9b66b0587d0a631357bebfbfc566fa7b (diff) | |
| parent | ebe4711df82e70f5ac1be5921a5654f33746e185 (diff) | |
| download | mruby-47d1701fb4d94c8710c4045372c6aa9dd4f5e909.tar.gz mruby-47d1701fb4d94c8710c4045372c6aa9dd4f5e909.zip | |
Merge pull request #1795 from cubicdaiya/issues/off_by_one_error
fix off-by-one error in String#rindex(fixnum)
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/string.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/t/string.rb b/test/t/string.rb index 2ebaad1b7..0556d12af 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -330,6 +330,9 @@ assert('String#rindex', '15.2.10.5.31') do assert_nil 'abc'.rindex('d') assert_equal 0, 'abcabc'.rindex('a', 1) assert_equal 3, 'abcabc'.rindex('a', 4) + + assert_equal 3, 'abcabc'.rindex(97) + assert_equal nil, 'abcabc'.rindex(0) end # 'String#scan', '15.2.10.5.32' will be tested in mrbgems. |
