mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
Fix String#partition
Split with the matched part when the separator matches the empty part at the beginning. [Bug #11014]
This commit is contained in:
parent
0b6682dc57
commit
fce54a5404
2 changed files with 2 additions and 1 deletions
|
@ -2567,6 +2567,8 @@ CODE
|
|||
hello = "hello"
|
||||
hello.partition("hi").map(&:upcase!)
|
||||
assert_equal("hello", hello, bug)
|
||||
|
||||
assert_equal(["", "", "foo"], "foo".partition(/^=*/))
|
||||
end
|
||||
|
||||
def test_rpartition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue