From bb4329becdce611519c8e6486661969ede17f704 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 25 Dec 2008 09:36:40 +0000 Subject: * io.c (pipe_close): removed. (pipe_yield): defined. (rb_io_s_pipe): use pipe_yield. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 7739535ecd..c3fbbd6905 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -50,6 +50,19 @@ class TestIO < Test::Unit::TestCase assert(x[1].closed?) end + def test_pipe_block_close + 4.times {|i| + x = nil + IO.pipe {|r, w| + x = [r,w] + r.close if (i&1) == 0 + w.close if (i&2) == 0 + } + assert(x[0].closed?) + assert(x[1].closed?) + } + end + def test_gets_rs # default_rs r, w = IO.pipe -- cgit v1.2.3