summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 08:58:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 08:58:05 +0000
commit08e698d4df6f7147708e025ca25f48cb6b1c333d (patch)
treecd63ecf10fd82a0737d322329a106d28e43d39fd /test/ruby
parent6491028d5b64da1e0a27d9017ca00b4da8ce94a8 (diff)
merge revision(s) 46243,46244: [Backport #9882] [Backport #9883]
* string.c (rb_str_substr): need to reset code range for shared string too, not only copied string. [ruby-core:62842] [Bug #9882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 1caca75247..ed888a1e42 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1190,6 +1190,11 @@ class TestString < Test::Unit::TestCase
assert_equal(S("Bar"), S("FooBar").slice(S("Bar")))
assert_nil(S("FooBar").slice(S("xyzzy")))
assert_nil(S("FooBar").slice(S("plugh")))
+
+ bug9882 = '[ruby-core:62842] [Bug #9882]'
+ substr = S("\u{30c6 30b9 30c8 2019}#{bug9882}").slice(4..-1)
+ assert_equal(S(bug9882).hash, substr.hash, bug9882)
+ assert_predicate(substr, :ascii_only?, bug9882)
end
def test_slice!