1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/lib/leakchecker.rb: Add check_verbose

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-03-31 02:29:19 +00:00
parent a88a03e6b3
commit d0775a1120

View file

@ -6,6 +6,7 @@ class LeakChecker
@thread_info = find_threads
@env_info = find_env
@encoding_info = find_encodings
@old_verbose = $VERBOSE
end
def check(test_name)
@ -16,6 +17,7 @@ class LeakChecker
check_env(test_name),
check_encodings(test_name),
check_safe(test_name),
check_verbose(test_name),
]
GC.start if leaks.any?
end
@ -24,6 +26,10 @@ class LeakChecker
puts "#{test_name}: $SAFE == #{$SAFE}" unless $SAFE == 0
end
def check_verbose test_name
puts "#{test_name}: $VERBOSE == #{$VERBOSE}" unless @old_verbose == $VERBOSE
end
def find_fds
if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
m[:close]