diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 10:27:53 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 10:27:53 +0000 |
| commit | 4acfeb7624b785cc11dc7d87a23c4c10dfc3a3dc (patch) | |
| tree | 98bcc93fc04411983aaa26b10c7cde618d660fa5 /test/ruby | |
| parent | 98c6296f41bf8378c217e32512f7e7c0ffb11eda (diff) | |
| download | ruby-4acfeb7624b785cc11dc7d87a23c4c10dfc3a3dc.tar.gz ruby-4acfeb7624b785cc11dc7d87a23c4c10dfc3a3dc.tar.xz ruby-4acfeb7624b785cc11dc7d87a23c4c10dfc3a3dc.zip | |
add tests.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_m17n.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 1087d182a..6bc9025f1 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -48,7 +48,17 @@ EOT 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) } } @@ -83,6 +93,15 @@ EOT } 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| |
