* test/ruby/test_io.rb (test_new_with_block): Set autoclose to avoid EBADF.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-09-02 13:45:20 +00:00
parent 6bd80ffc22
commit 51f41f6618
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Tue Sep 2 22:43:52 2014 Tanaka Akira <akr@fsij.org>
* test/ruby/test_io.rb (test_new_with_block): Set autoclose to avoid
EBADF.
Tue Sep 2 22:01:51 2014 Kouhei Sutou <kou@cozmixng.org> Tue Sep 2 22:01:51 2014 Kouhei Sutou <kou@cozmixng.org>
* Makefile.in (update-coverage): Remove a never executed line. * Makefile.in (update-coverage): Remove a never executed line.

View File

@ -2282,11 +2282,15 @@ End
end end
def test_new_with_block def test_new_with_block
assert_in_out_err([], "r, w = IO.pipe; IO.new(r.fileno) {}", [], /^.+$/) assert_in_out_err([], "r, w = IO.pipe; r.autoclose=false; IO.new(r.fileno) {}.close", [], /^.+$/)
n = "IO\u{5165 51fa 529b}" n = "IO\u{5165 51fa 529b}"
c = eval("class #{n} < IO; self; end") c = eval("class #{n} < IO; self; end")
IO.pipe do |r, w| IO.pipe do |r, w|
assert_warning(/#{n}/) {c.new(r.fileno) {}} assert_warning(/#{n}/) {
r.autoclose=false
io = c.new(r.fileno) {}
io.close
}
end end
end end