From 632652a2442d364d38b72cc3bf7ebc4cc2fb9b12 Mon Sep 17 00:00:00 2001 From: kosaki Date: Sat, 12 Nov 2011 02:32:16 +0000 Subject: * test/ruby/test_io.rb (test_fcntl_dupfd): add another fcntl test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 21a215d67a..8bd0a4b90c 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1918,6 +1918,17 @@ End end end + def test_fcntl_dupfd + Tempfile.open(self.class.name) do |f| + fd = f.fcntl(Fcntl::F_DUPFD, 500) + begin + assert_equal(fd, 500) + ensure + IO.for_fd(fd).close + end + end + end + def test_cross_thread_close_fd skip "cross thread close causes hung-up if pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM with_pipe do |r,w| -- cgit v1.2.3