diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-23 07:09:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-23 07:09:05 +0000 |
commit | b0326bce01af3c6c29a29672875b6618964088bc (patch) | |
tree | 3e3472ad910774ff26413b732c7d526733ba6039 /test | |
parent | 80aa804a3372424e91bd4b01cffd4600b63bbd54 (diff) |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index c7f4521e27..b90c620381 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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 |