* string.c (rb_str_rpartition): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-05-24 23:06:57 +00:00
parent 7102c3b1a1
commit d629684bb9
3 changed files with 6 additions and 1 deletions

View file

@ -1712,6 +1712,8 @@ class TestString < Test::Unit::TestCase
assert_equal(%w(hel l o), "hello".rpartition(/l/))
assert_equal(%w(hel l o), "hello".rpartition("l"))
assert_raise(TypeError) { "hello".rpartition(1) }
def (hyphen = Object.new).to_str; "-"; end
assert_equal(%w(foo - bar), "foo-bar".rpartition(hyphen), '[ruby-core:23540]')
end
def test_setter