From fce54a5404139a77bd0b7d6f82901083fcb16f1e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 16 Jan 2020 15:36:38 +0900 Subject: Fix `String#partition` Split with the matched part when the separator matches the empty part at the beginning. [Bug #11014] --- test/ruby/test_string.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 09d099bb4a..f0b765314c 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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 -- cgit v1.2.3