aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-13 21:26:32 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-13 21:26:32 +0000
commit7151598d5b2bc8a36995380be814a3183e4461c6 (patch)
tree0c81ef5a62f99b0ff207b53abeea1931def92434 /test/ruby/test_io.rb
parent0ebf2afa814a82dec149c37e51e09698ea527bad (diff)
downloadruby-7151598d5b2bc8a36995380be814a3183e4461c6.tar.gz
* test/ruby/test_io.rb: add test for IO.binread fd leak.
See r50881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 873da119be..9b3e80160d 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2740,6 +2740,10 @@ End
end
end
+ def test_s_binread_does_not_leak_with_invalid_offset
+ assert_raise(Errno::EINVAL) { IO.binread(__FILE__, 0, -1) }
+ end
+
def test_s_binwrite
mkcdtmpdir do
path = "test_s_binwrite"