aboutsummaryrefslogtreecommitdiffstats
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 07:21:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 07:21:13 +0000
commit256800ffa0390e17a5c30419a7d2af797a76011c (patch)
tree7b3a6505f3c749305b3913282cb33242c1753764 /test/stringio
parent8e6cf0de39e58a5e345eb981b3e5b2c0ea06ec64 (diff)
downloadruby-256800ffa0390e17a5c30419a7d2af797a76011c.tar.gz
stringio.c: encoding at empty result
* ext/stringio/stringio.c (strio_gets): should return string with the external encoding, at empty result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 89fc54e922..8faf4d8acc 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -79,6 +79,8 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("def\n", stringio.gets(""))
assert_raise(TypeError){StringIO.new("").gets(1, 1)}
assert_nothing_raised {StringIO.new("").gets(nil, nil)}
+
+ assert_string("", Encoding::UTF_8, StringIO.new("foo").gets(0))
end
def test_gets_chomp