diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 15:59:05 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 15:59:05 +0000 |
commit | 4fe6fa884957545c0cecaee8ac4ebaa636904a43 (patch) | |
tree | 0a18f378bd520366f8ae2f4d082d89b09547bc7f /test/ruby/test_io.rb | |
parent | 2a37152f3fa3cd90f786c581dcc8d93b6279c288 (diff) | |
download | ruby-4fe6fa884957545c0cecaee8ac4ebaa636904a43.tar.gz |
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
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 18 |
1 files changed, 18 insertions, 0 deletions
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 |