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
commitdcb7cc1a8b76b1691b59192474cb7f193acd75cd (patch)
tree641b343f1c9b7ee05d53d6d7e0a6bd2c2519b850 /test/stringio
parente9930a4b56c874a73d9400a5568e3fa52a139138 (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/trunk@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 0258218..26fcc62 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