From 71f40a1d962572c9a863a97592222320f6702ec5 Mon Sep 17 00:00:00 2001 From: eregon Date: Sat, 13 Jun 2015 21:26:32 +0000 Subject: * 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 --- test/ruby/test_io.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') 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" -- cgit v1.2.3