[前][次][番号順一覧][スレッド一覧]

ruby-changes:29950

From: nobu <ko1@a...>
Date: Tue, 16 Jul 2013 18:45:09 +0900 (JST)
Subject: [ruby-changes:29950] nobu:r42002 (trunk): test_string.rb: Bug #8642

nobu	2013-07-16 18:45:00 +0900 (Tue, 16 Jul 2013)

  New Revision: 42002

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42002

  Log:
    test_string.rb: Bug #8642
    
    * test/ruby/test_string.rb (test_split): test for r41994.
      [ruby-core:56036] [Bug #8642]

  Modified files:
    trunk/test/ruby/test_string.rb

Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 42001)
+++ test/ruby/test_string.rb	(revision 42002)
@@ -1320,6 +1320,17 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1320
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]