diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-25 12:45:03 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-25 12:45:03 +0000 |
commit | 2f6f2bfb0211a7f9a278a20bce69472fa78048f3 (patch) | |
tree | a87c43d9eb79be50143ea51d6cd23cd41208aec8 /bootstraptest | |
parent | a50ef07e16b8d09073c34ba3124868b22917972f (diff) | |
download | ruby-2f6f2bfb0211a7f9a278a20bce69472fa78048f3.tar.gz |
* io.c (io_ungetc): reallocate internal buffer if pushing data
excess capacity. [ruby-dev:31650]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_knownbug.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index 03feb653a3..07ba5e8e2c 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -6,11 +6,15 @@ assert_equal 'ok', %q{ begin r, w = IO.pipe + w.write "foo" w.close # assert_raise(IOError, "[ruby-dev:31650]") { 20000.times { r.ungetc "a" } } + r.getc 20000.times { r.ungetc "a" } -rescue IOError - :ok + data = r.read + if data.size == 20002 && data[-5..-1] == "aaaoo" + :ok + end ensure r.close end |