diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-12 02:32:16 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-12 02:32:16 +0000 |
commit | 632652a2442d364d38b72cc3bf7ebc4cc2fb9b12 (patch) | |
tree | 5e3c12c39fc1fa98fed9a1898427dea6cb775e60 /test | |
parent | f2708ce30f0bf7c7a0ace010a7f8461de1e41f8b (diff) | |
download | ruby-632652a2442d364d38b72cc3bf7ebc4cc2fb9b12.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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| |