test_io.rb: fix tempfile leaks
* test/ruby/test_io.rb (test_flush_in_finalizer2): cannot unlink opened file on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8f61283031
commit
fdb4c75a65
@ -2396,6 +2396,7 @@ End
|
|||||||
Tempfile.open("bug3910") {|t|
|
Tempfile.open("bug3910") {|t|
|
||||||
path = t.path
|
path = t.path
|
||||||
t.close
|
t.close
|
||||||
|
begin
|
||||||
1.times do
|
1.times do
|
||||||
io = open(path,"w")
|
io = open(path,"w")
|
||||||
io.instance_variable_set(:@test_flush_in_finalizer2, true)
|
io.instance_variable_set(:@test_flush_in_finalizer2, true)
|
||||||
@ -2404,8 +2405,6 @@ End
|
|||||||
assert_nothing_raised(TypeError, bug3910) do
|
assert_nothing_raised(TypeError, bug3910) do
|
||||||
GC.start
|
GC.start
|
||||||
end
|
end
|
||||||
t.close!
|
|
||||||
}
|
|
||||||
ensure
|
ensure
|
||||||
ObjectSpace.each_object(File) {|f|
|
ObjectSpace.each_object(File) {|f|
|
||||||
if f.instance_variables.include?(:@test_flush_in_finalizer2)
|
if f.instance_variables.include?(:@test_flush_in_finalizer2)
|
||||||
@ -2413,6 +2412,9 @@ End
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
t.close!
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def test_readlines_limit_0
|
def test_readlines_limit_0
|
||||||
bug4024 = '[ruby-dev:42538]'
|
bug4024 = '[ruby-dev:42538]'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user