From 2d3808eeac6ea951797fa53cb857919aa0d7d4cf Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 25 Feb 2013 12:18:48 +0000 Subject: * 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/trunk@39495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 4e55198a15..a0fb80f46e 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2181,6 +2181,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