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

ruby-changes:21103

From: usa <ko1@a...>
Date: Thu, 1 Sep 2011 10:23:10 +0900 (JST)
Subject: [ruby-changes:21103] usa:r33152 (trunk): * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,

usa	2011-09-01 10:22:58 +0900 (Thu, 01 Sep 2011)

  New Revision: 33152

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

  Log:
    * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
      default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
      committed in r33144.  I'd misunderstood the spec of ruby's universal
      newline.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33151)
+++ ChangeLog	(revision 33152)
@@ -1,3 +1,10 @@
+Thu Sep  1 10:20:50 2011  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+	  default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
+	  committed in r33144.  I'd misunderstood the spec of ruby's universal
+	  newline.
+
 Thu Sep  1 09:27:57 2011  NARUSE, Yui  <naruse@r...>
 
 	* variable.c (rb_autoloading_value) Fix the order of definitions.
Index: test/ruby/test_io_m17n.rb
===================================================================
--- test/ruby/test_io_m17n.rb	(revision 33151)
+++ test/ruby/test_io_m17n.rb	(revision 33152)
@@ -2072,29 +2072,29 @@
 
   def test_default_mode_on_dosish
     with_tmpdir {
-      open("a", "w") {|f| f.puts}
+      open("a", "w") {|f| f.write "\n"}
       assert_equal("\r\n", IO.binread("a"))
     }
   end if /mswin|mingw/ =~ RUBY_PLATFORM
 
   def test_default_mode_on_unix
     with_tmpdir {
-      open("a", "w") {|f| f.puts}
+      open("a", "w") {|f| f.write "\n"}
       assert_equal("\n", IO.binread("a"))
     }
   end unless /mswin|mingw/ =~ RUBY_PLATFORM
 
   def test_text_mode
     with_tmpdir {
-      open("a", "wt") {|f| f.puts}
-      assert_equal("\r\n", IO.binread("a"))
+      open("a", "wb") {|f| f.write "\r\n"}
+      assert_equal("\n", open("a", "rt"){|f| f.read})
     }
   end
 
   def test_binary_mode
     with_tmpdir {
-      open("a", "wb") {|f| f.puts}
-      assert_equal("\n", IO.binread("a"))
+      open("a", "wb") {|f| f.write "\r\n"}
+      assert_equal("\r\n", open("a", "rb"){|f| f.read})
     }
   end
 end

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

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