summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/stringio/test_stringio.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index ce84800d4b..5dd5de988a 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -686,7 +686,13 @@ class TestStringIO < Test::Unit::TestCase
assert_separately(%w[-rstringio], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;
limit = #{limit}
- x = ("a"*0x100000)
+ ary = []
+ while true
+ x = "a"*0x100000
+ break if [x].pack("p").unpack("i!")[0] < 0
+ ary << x
+ skip if ary.size > 1000
+ end
s = StringIO.new(x)
s.gets("xxx", limit)
assert_equal(0x100000, s.pos)