From bfcd4e54538b1dd415ed1f3bebe482df11b383c2 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 2 Dec 2010 22:08:45 +0000 Subject: * 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 --- test/stringio/test_stringio.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/stringio') 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 -- cgit v1.2.3