diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-22 14:44:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-22 14:44:20 +0000 |
commit | 61d807ccfae5500d1471f1074a6671ac9f191c88 (patch) | |
tree | b75fea84c7de9f49cdcbeace800fce81421b5f32 /test/ruby | |
parent | 7389ac15be042f242135f464530b66ca4419b933 (diff) | |
download | ruby-61d807ccfae5500d1471f1074a6671ac9f191c88.tar.gz |
string.c: fix coderange of reverse
* string.c (rb_str_reverse): reversed string is not a substring,
and should not set coderange of the original string.
[ruby-dev:49189] [Bug #11387]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_m17n.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 94a32591cb..d655dbf9e7 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1142,7 +1142,12 @@ class TestM17N < Test::Unit::TestCase end def test_reverse - assert_equal(u("\xf0jihgfedcba"), u("abcdefghij\xf0").reverse) + bug11387 = '[ruby-dev:49189] [Bug #11387]' + s1 = u("abcdefghij\xf0") + s2 = s1.reverse + assert_not_predicate(s1, :valid_encoding?, bug11387) + assert_equal(u("\xf0jihgfedcba"), s2) + assert_not_predicate(s2, :valid_encoding?, bug11387) end def test_reverse_bang |