diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-27 02:55:41 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-27 02:55:41 +0000 |
| commit | cf80deed4fb55405ef065a05db96b9976cf1e226 (patch) | |
| tree | bf7dbd861badc4da992f59cebff0f1e277c2bbd7 /test/stringio | |
| parent | 018794282bd2147e091ab1c7a2e2c0d26b3cece4 (diff) | |
merges r25127 from trunk into ruby_1_9_1.
--
* stringio/stringio.c (strio_read): set ASCII-8BIT encoding
when length argument is given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
| -rw-r--r-- | test/stringio/test_stringio.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 4d1fdf28d..01bdbaa6d 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -384,9 +384,12 @@ class TestStringIO < Test::Unit::TestCase end def test_read - f = StringIO.new("1234") + f = StringIO.new("\u3042\u3044") assert_raise(ArgumentError) { f.read(-1) } assert_raise(ArgumentError) { f.read(1, 2, 3) } + assert_equal("\u3042\u3044", f.read) + f.rewind + assert_equal("\u3042\u3044".force_encoding(Encoding::ASCII_8BIT), f.read(f.size)) end def test_size |
