Merge pull request #2079 from suzukaze/add-test-of-utf8-string.rindex

Add tests for String#rindex of mruby-string-utf8.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-19 12:02:52 +09:00
+7
View File
@@ -59,3 +59,10 @@ assert('String#split') do
got = "こんにちわ世界!".split('に')
assert_equal ['こん', 'ちわ世界!'], got
end
assert('String#rindex') do
str = "こんにちわ世界!\nこんにちわ世界!"
assert_nil str.index('さ')
assert_equal 12, str.rindex('ち')
assert_equal 3, str.rindex('ち', 10)
end