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

ruby-changes:3033

From: ko1@a...
Date: 24 Dec 2007 00:06:32 +0900
Subject: [ruby-changes:3033] akr - Ruby:r14525 (trunk): move the test for .

akr	2007-12-24 00:06:14 +0900 (Mon, 24 Dec 2007)

  New Revision: 14525

  Added files:
    trunk/test/ruby/test_io_m17n.rb
  Modified files:
    trunk/bootstraptest/test_knownbug.rb

  Log:
    move the test for [ruby-core:14288].


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_io_m17n.rb?revision=14525&view=markup
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=14525&r2=14524

Index: bootstraptest/test_knownbug.rb
===================================================================
--- bootstraptest/test_knownbug.rb	(revision 14524)
+++ bootstraptest/test_knownbug.rb	(revision 14525)
@@ -4,14 +4,6 @@
 #
 
 assert_equal 'ok', %q{
-  open("tmp", "w") {|f| f.write "a\u00FFb" }
-  s = open("tmp", "r:iso-8859-1:utf-8") {|f|
-    f.gets("\xFF".force_encoding("iso-8859-1"))
-  }
-  s == "a\xFF" ? :ok : :ng
-}, '[ruby-core:14288]'
-
-assert_equal 'ok', %q{
   open("require-lock-test.rb", "w") {|f|
     f.puts "sleep 0.1"
     f.puts "module M"
Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb	(revision 0)
+++ test/ruby/test_io_m17n.rb	(revision 14525)
@@ -0,0 +1,22 @@
+require 'test/unit'
+require 'tmpdir'
+
+class TestIOM17N < Test::Unit::TestCase
+  def with_tmpdir
+    Dir.mktmpdir {|dir|
+      Dir.chdir dir
+      yield dir
+    }
+  end
+
+  def test_conversion
+    with_tmpdir {
+      open("tmp", "w") {|f| f.write "before \u00FF after" }
+      s = open("tmp", "r:iso-8859-1:utf-8") {|f|
+        f.gets("\xFF".force_encoding("iso-8859-1"))
+      }
+      assert_equal("before \xFF".force_encoding("iso-8859-1"), s, '[ruby-core:14288]')
+    }
+  end
+end
+

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

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