зеркало из https://github.com/github/ruby.git
Retry until the signal is trapped.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7db062cdc0
Коммит
a07cef02a9
|
@ -17,7 +17,10 @@ class TestSignal < Test::Unit::TestCase
|
|||
x = 0
|
||||
oldtrap = Signal.trap(:INT) {|sig| x = 2 }
|
||||
Process.kill :INT, Process.pid
|
||||
sleep 0.1
|
||||
10.times do
|
||||
break if 2 == x
|
||||
sleep 0.1
|
||||
end
|
||||
assert_equal 2, x
|
||||
|
||||
Signal.trap(:INT) { raise "Interrupt" }
|
||||
|
|
Загрузка…
Ссылка в новой задаче