summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-28 01:08:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-28 01:08:24 +0000
commitb07650769e112ecb33d1738eef4d61727183d9c7 (patch)
tree38998aa03ebd66fb1c972b342ce9af27fd540cc2 /test/stringio
parentea229a855f3d12271aea16913ba3c2d78f0cc3ea (diff)
* stringio/stringio.c (strio_read): set ASCII-8BIT encoding
when length argument is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index df292e8a89..212315ae10 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -382,9 +382,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