From 9cdc7f9db0ed33bc1ab3aafe299c9403190dda18 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 1 Sep 2011 01:22:58 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/ruby/test_io_m17n.rb | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c3e324051..1c9b1e8794 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Sep 1 10:20:50 2011 NAKAMURA Usaku + + * 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 * variable.c (rb_autoloading_value) Fix the order of definitions. diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 01dca47f7f..f62ded90cb 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2072,29 +2072,29 @@ EOT 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