зеркало из https://github.com/github/ruby.git
specify exception class for rescue clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b83188dc1e
Коммит
ad235344c4
|
@ -111,13 +111,21 @@ class TestProcess < Test::Unit::TestCase
|
|||
s = run_in_child(<<-'End')
|
||||
cur, max = Process.getrlimit(:NOFILE)
|
||||
Process.setrlimit(:NOFILE, max-10)
|
||||
Process.setrlimit(:NOFILE, :INFINITY) rescue exit 1
|
||||
begin
|
||||
Process.setrlimit(:NOFILE, :INFINITY)
|
||||
rescue Errno::EPERM
|
||||
exit 1
|
||||
end
|
||||
End
|
||||
assert_not_equal(0, s.exitstatus)
|
||||
s = run_in_child(<<-'End')
|
||||
cur, max = Process.getrlimit(:NOFILE)
|
||||
Process.setrlimit(:NOFILE, max-10)
|
||||
Process.setrlimit(:NOFILE, "INFINITY") rescue exit 1
|
||||
begin
|
||||
Process.setrlimit(:NOFILE, "INFINITY")
|
||||
rescue Errno::EPERM
|
||||
exit 1
|
||||
end
|
||||
End
|
||||
assert_not_equal(0, s.exitstatus)
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче