test_io.rb: add test

* test/ruby/test_io.rb (tesst_pid_after_close_read): test for r43117.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-10-02 07:48:19 +00:00
parent bda5eac115
commit a2d21de1c8

View File

@ -1409,6 +1409,17 @@ class TestIO < Test::Unit::TestCase
assert_raise(IOError) { pipe.pid }
end
def tesst_pid_after_close_read
pid1 = pid2 = nil
IO.popen(["echo", ""], "r+") do |io|
pid1 = io.pid
io.close_read
pid2 = io.pid
end
assert_not_nil(pid1)
assert_equal(pid1, pid2)
end
def make_tempfile
t = Tempfile.new("test_io")
t.binmode