From d2b2159fbd9169b3370123a13bbb4e7721bceb7c Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 10 Mar 2013 16:05:14 +0000 Subject: merge revision(s) 39495: [Backport #7954] * string.c (str_byte_substr): don't set coderange if it's not known. [Bug #7954] [ruby-dev:47108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby/test_string.rb') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 7b4dc2951d..43be67893c 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2180,6 +2180,10 @@ class TestString < Test::Unit::TestCase assert_equal(u("\x81\x82"), "\u3042".byteslice(1..2)) assert_equal(u("\x82")+("\u3042"*9), ("\u3042"*10).byteslice(2, 28)) + + bug7954 = '[ruby-dev:47108]' + assert_equal(false, "\u3042".byteslice(0, 2).valid_encoding?) + assert_equal(false, ("\u3042"*10).byteslice(0, 20).valid_encoding?) end end -- cgit v1.2.3