diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 09:32:06 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 09:32:06 +0000 |
commit | 014236612a0be2f07ac6e645bd5a32ddbe4c8b0f (patch) | |
tree | 58132d19eda328f2cf891ec4eff8f9e0d5b7785c /test/ruby | |
parent | b4a2e268ea165c0b4321d76b68467ca6ca61a9aa (diff) | |
download | ruby-014236612a0be2f07ac6e645bd5a32ddbe4c8b0f.tar.gz |
Fix String#rpartition(/re/) against a multibyte string.
* string.c (rb_str_rpartition): Fix String#rpartition(/re/)
against a multibyte string. [Bug #8138] [ruby-dev:47183]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index a0fb80f46e..4d9f7d95b0 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1998,6 +1998,9 @@ class TestString < Test::Unit::TestCase s = S("a:".force_encoding(enc)) assert_equal([enc]*3, s.partition("|").map(&:encoding), bug6206) end + + assert_equal(["\u30E6\u30FC\u30B6", "@", "\u30C9\u30E1.\u30A4\u30F3"], + "\u30E6\u30FC\u30B6@\u30C9\u30E1.\u30A4\u30F3".partition(/[@.]/)) end def test_rpartition @@ -2013,6 +2016,10 @@ class TestString < Test::Unit::TestCase s = S("a:".force_encoding(enc)) assert_equal([enc]*3, s.rpartition("|").map(&:encoding), bug6206) end + + bug8138 = '[ruby-dev:47183]' + assert_equal(["\u30E6\u30FC\u30B6@\u30C9\u30E1", ".", "\u30A4\u30F3"], + "\u30E6\u30FC\u30B6@\u30C9\u30E1.\u30A4\u30F3".rpartition(/[@.]/), bug8138) end def test_setter |