summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-20 01:43:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-20 01:43:26 +0000
commitaade9453c8c27856b382fb7fb5ad4516a14c7caf (patch)
treec5f09649a80cc43b9eada6d4682f835dd68b545a /test/stringio
parente20f354a7389148ec1068e2f4c5ccae4626d4c64 (diff)
* ext/stringio/stringio.c (strio_read): return new string if nil
is explicitly given as a buffer ([Bug #5207]), otherwise set the encoding. also removed dead code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 0258218755..26fcc624e2 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -418,6 +418,14 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("\u3042\u3044", f.read)
f.rewind
assert_equal("\u3042\u3044".force_encoding(Encoding::ASCII_8BIT), f.read(f.size))
+
+ bug5207 = '[ruby-core:39026]'
+ f.rewind
+ assert_equal("\u3042\u3044", f.read(nil, nil), bug5207)
+ f.rewind
+ s = ""
+ f.read(nil, s)
+ assert_equal("\u3042\u3044", s, bug5207)
end
def test_readpartial