summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 07:31:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 07:31:49 +0000
commite022015c62694f56f0e2d7bf6d3bbb09dafcaf24 (patch)
tree6d4b11dd4d6af8a88168e0568732dbd042bb235a /test/stringio/test_stringio.rb
parent24d03b22046ec02e7abd71f2a5ac443d9bd50699 (diff)
stringio.c: encoding at empty chomped result
* ext/stringio/stringio.c (strio_gets): should return string with the external encoding, at empty chomped result . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio/test_stringio.rb')
-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 8faf4d8acc..7b9b1105d1 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -96,6 +96,8 @@ class TestStringIO < Test::Unit::TestCase
stringio = StringIO.new("abc\n\ndef\n")
assert_equal("abc\n", stringio.gets("", chomp: true))
assert_equal("def", stringio.gets("", chomp: true))
+
+ assert_string("", Encoding::UTF_8, StringIO.new("\n").gets(chomp: true))
end
def test_gets_chomp_eol