From 67a3f2eebce948c695ae37ee7ebd1a5f2dd9f7a2 Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 20 Jun 2009 09:07:02 +0000 Subject: merges r23562 and r23564 from trunk into ruby_1_9_1. -- * string.c (rb_str_partition): should use the converted result. a patch from Marc-Andre Lafortune at [ruby-core:23540]. -- * string.c (rb_str_rpartition): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index f6f3dd76b2..bf0ed6a830 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1699,12 +1699,16 @@ 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 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 -- cgit v1.2.3