diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:44:41 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:44:41 +0000 |
commit | 51954bd21f990be9a4b8aaabbedfca3f61b13f44 (patch) | |
tree | a4911d237fdf48cc88b406084594fa58c26a2cac /test | |
parent | a61756e094462e6548113a7407652230f1f85161 (diff) |
merge revision(s) 51344: [Backport #11387]
* 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/branches/ruby_2_1@51600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 7d00b1aec6..60818cd44e 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1132,7 +1132,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 |