mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
2a37152f3f
commit
4fe6fa8849
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue