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

add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-24 10:27:53 +00:00
parent b132f72b3f
commit 23f0e341af

View file

@ -48,7 +48,17 @@ EOT
with_tmpdir { with_tmpdir {
generate_file('tmp', "") generate_file('tmp', "")
open("tmp", "r") {|f| 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) assert_equal(nil, f.internal_encoding)
} }
} }
@ -83,6 +93,15 @@ EOT
} }
end 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 def test_open_w_enc
with_tmpdir { with_tmpdir {
open("tmp", "w:euc-jp") {|f| open("tmp", "w:euc-jp") {|f|