1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,

default_mode_on_unix,text_mode,binary_mode}): tests for [Bug # 5164].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2011-08-31 07:29:57 +00:00
parent c06658feba
commit 8b74d0c3fb
2 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 31 16:28:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
default_mode_on_unix,text_mode,binary_mode}): tests for [Bug #5164].
Wed Aug 31 15:54:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
* ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).

View file

@ -2069,5 +2069,32 @@ EOT
}
assert(c.ascii_only?, "should be ascii_only #{bug4557}")
end
end
def test_default_mode_on_dosish
with_tmpdir {
open("a", "w") {|f| f.puts}
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}
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"))
}
end
def test_binary_mode
with_tmpdir {
open("a", "wb") {|f| f.puts}
assert_equal("\n", IO.binread("a"))
}
end
end