From 08e698d4df6f7147708e025ca25f48cb6b1c333d Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 27 Jun 2014 08:58:05 +0000 Subject: 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 --- test/ruby/test_string.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby/test_string.rb') 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! -- cgit v1.2.3