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

ruby-changes:3108

From: ko1@a...
Date: 24 Dec 2007 19:28:07 +0900
Subject: [ruby-changes:3108] akr - Ruby:r14600 (trunk): add tests.

akr	2007-12-24 19:27:53 +0900 (Mon, 24 Dec 2007)

  New Revision: 14600

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

  Log:
    add tests.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_io_m17n.rb?r1=14600&r2=14599

Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb	(revision 14599)
+++ test/ruby/test_io_m17n.rb	(revision 14600)
@@ -48,12 +48,22 @@
     with_tmpdir {
       generate_file('tmp', "")
       open("tmp", "r") {|f|
-        assert_equal(nil, f.external_encoding)
+        assert_equal(Encoding.default_external, f.external_encoding)
         assert_equal(nil, f.internal_encoding)
       }
     }
   end
 
+  def test_open_rb
+    with_tmpdir {
+      generate_file('tmp', "")
+      open("tmp", "rb") {|f|
+        assert_equal(Encoding::ASCII_8BIT, f.external_encoding)
+        assert_equal(nil, f.internal_encoding)
+      }
+    }
+  end
+
   def test_open_r_enc
     with_tmpdir {
       generate_file('tmp', "")
@@ -83,6 +93,15 @@
     }
   end
 
+  def test_open_wb
+    with_tmpdir {
+      open("tmp", "wb") {|f|
+        assert_equal(nil, f.external_encoding)
+        assert_equal(nil, f.internal_encoding)
+      }
+    }
+  end
+
   def test_open_w_enc
     with_tmpdir {
       open("tmp", "w:euc-jp") {|f|

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

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