From 4fe6fa884957545c0cecaee8ac4ebaa636904a43 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 8 Sep 2007 15:59:05 +0000 Subject: add test for [ruby-dev:31650] and [ruby-dev:31659]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index b256a2730d..2ccc0aaa8d 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -35,4 +35,22 @@ class TestIO < Test::Unit::TestCase assert_nil r.gets("") r.close end + + def test_ungetc + r, w = IO.pipe + w.close + assert_raise(IOError, "[ruby-dev:31650]") { 20000.times { r.ungetc "a" } } + ensure + r.close + end + + def test_each_byte + r, w = IO.pipe + w << "abc def" + w.close + r.each_byte {|byte| break if byte == 32 } + assert_equal("def", r.read, "[ruby-dev:31659]") + ensure + r.close + end end -- cgit v1.2.3