зеркало из https://github.com/github/ruby.git
Put the result of the process into a variable once
To make the meaning of assertion easier to understand,
This commit is contained in:
Родитель
01e49af81d
Коммит
4f324514aa
|
@ -539,18 +539,20 @@ module BasetestReadline
|
|||
log << "** Errno::EPIPE **"
|
||||
# The "write" will fail if Reline crashed by SIGINT.
|
||||
end
|
||||
interrupt_suppressed = nil
|
||||
loop do
|
||||
c = _out.read(1)
|
||||
log << c if c
|
||||
if log.include?('FAILED')
|
||||
assert false, "Should handle SIGINT correctly but raised interrupt.\nLog: #{log}\n----"
|
||||
interrupt_suppressed = false
|
||||
break
|
||||
end
|
||||
if log.include?('SUCCEEDED')
|
||||
assert false, "Should handle SIGINT correctly but exited successfully.\nLog: #{log}\n----"
|
||||
interrupt_suppressed = true
|
||||
break
|
||||
end
|
||||
end
|
||||
assert interrupt_suppressed, "Should handle SIGINT correctly but raised interrupt.\nLog: #{log}\n----"
|
||||
rescue Timeout::Error => e
|
||||
assert false, "Timed out to handle SIGINT!\nLog: #{log}\nBacktrace:\n#{e.full_message(highlight: false)}\n----"
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче