summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-24 22:50:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-24 22:50:11 +0000
commitec879e5197c691d31d5383f47e310cbafd765abf (patch)
tree0a864c7e3f5c3c4d6e603b6e11afd25b288d4839 /test/ruby
parentde9d2aae39623ef6e81222fff33062bc624c6e87 (diff)
downloadruby-ec879e5197c691d31d5383f47e310cbafd765abf.tar.gz
ruby-ec879e5197c691d31d5383f47e310cbafd765abf.tar.xz
ruby-ec879e5197c691d31d5383f47e310cbafd765abf.zip
* string.c (rb_str_partition): should use the converted result. a
patch from Marc-Andre Lafortune at [ruby-core:23540]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index e87b6d3c8..4a784b18f 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -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