mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
dup String#partition return value
* string.c (rb_str_partition): return duplicated receiver, when no splits. [ruby-core:82911] [Bug#13925] Author: Seiei Miyagi <hanachin@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
80aa804a33
commit
b0326bce01
2 changed files with 7 additions and 2 deletions
|
@ -2420,7 +2420,12 @@ CODE
|
|||
end
|
||||
|
||||
assert_equal(["\u30E6\u30FC\u30B6", "@", "\u30C9\u30E1.\u30A4\u30F3"],
|
||||
"\u30E6\u30FC\u30B6@\u30C9\u30E1.\u30A4\u30F3".partition(/[@.]/))
|
||||
"\u30E6\u30FC\u30B6@\u30C9\u30E1.\u30A4\u30F3".partition(/[@.]/))
|
||||
|
||||
bug = '[ruby-core:82911]'
|
||||
hello = "hello"
|
||||
hello.partition("hi").map(&:upcase!)
|
||||
assert_equal("hello", hello, bug)
|
||||
end
|
||||
|
||||
def test_rpartition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue