From 3341db313aeb9964e731ca0b2113456ea7303e23 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Jul 2013 09:45:00 +0000 Subject: test_string.rb: Bug #8642 * test/ruby/test_string.rb (test_split): test for r41994. [ruby-core:56036] [Bug #8642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby/test_string.rb') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 9db3d2cb0f..83bf78adc9 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1320,6 +1320,17 @@ class TestString < Test::Unit::TestCase s = S("a:".force_encoding(enc)) assert_equal([enc]*2, s.split(":", 2).map(&:encoding), bug6206) end + + bug8642 = '[ruby-core:56036] [Bug #8642]' + [ + Encoding::UTF_16BE, Encoding::UTF_16LE, + Encoding::UTF_32BE, Encoding::UTF_32LE, + ].each do |enc| + s = S("abc,def".encode(enc)) + assert_equal(["abc", "def"].map {|c| c.encode(enc)}, + s.split(",".encode(enc)), + "#{bug8642} in #{enc.name}") + end end def test_squeeze -- cgit v1.2.1