mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
* string.c (rb_str_partition): should use the converted result. a
patch from Marc-Andre Lafortune at [ruby-core:23540]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
74c7141705
commit
7a938f98f9
3 changed files with 8 additions and 0 deletions
|
@ -1704,6 +1704,8 @@ class TestString < Test::Unit::TestCase
|
|||
assert_equal(%w(he l lo), "hello".partition(/l/))
|
||||
assert_equal(%w(he l lo), "hello".partition("l"))
|
||||
assert_raise(TypeError) { "hello".partition(1) }
|
||||
def (hyphen = Object.new).to_str; "-"; end
|
||||
assert_equal(%w(foo - bar), "foo-bar".partition(hyphen), '[ruby-core:23540]')
|
||||
end
|
||||
|
||||
def test_rpartition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue