summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 22:08:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 22:08:45 +0000
commitbfcd4e54538b1dd415ed1f3bebe482df11b383c2 (patch)
treecd7525102def020f688ca4bbd27bf74814fc95d9 /test/stringio
parent15dad95dfcb092fea28ebc1e1a6aba6df119b1e0 (diff)
* ext/stringio/stringio.c (strio_getline): round upto next char
boundary. [ruby-dev:42674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 30284faee2..b7327adced 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -378,6 +378,12 @@ class TestStringIO < Test::Unit::TestCase
assert_equal("a" * 10000 + "zz", f.gets("zz"))
f = StringIO.new("a" * 10000 + "zz!")
assert_equal("a" * 10000 + "zz!", f.gets("zzz"))
+
+ bug4112 = '[ruby-dev:42674]'
+ ["a".encode("utf-16be"), "\u3042"].each do |s|
+ assert_equal(s, StringIO.new(s).gets(1), bug4112)
+ assert_equal(s, StringIO.new(s).gets(nil, 1), bug4112)
+ end
end
def test_each