summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-08 15:59:05 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-08 15:59:05 +0000
commit4fe6fa884957545c0cecaee8ac4ebaa636904a43 (patch)
tree0a18f378bd520366f8ae2f4d082d89b09547bc7f /test/ruby/test_io.rb
parent2a37152f3fa3cd90f786c581dcc8d93b6279c288 (diff)
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.rb18
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