aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-02 07:48:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-02 07:48:19 +0000
commita2d21de1c89e54fbda51883069fe2ecbbcc8f5db (patch)
tree279fa42d7f704aee9eeba7711a30156155837d90 /test
parentbda5eac1157d3c7d961b85db4831f04fc7db343a (diff)
downloadruby-a2d21de1c89e54fbda51883069fe2ecbbcc8f5db.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 437e7ae5b5..c95b25d5ef 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -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