diff options
author | aycabta <aycabta@gmail.com> | 2021-08-11 14:07:28 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-11 14:08:45 +0900 |
commit | 4f324514aa5b3dd598f31cf41602dd414e0fbaca (patch) | |
tree | d9da4f713ef3b37cbc65795d6d8efb44e0e45cbe /test/readline/test_readline.rb | |
parent | 01e49af81d5f17248c9338cb82b7278f41f9b972 (diff) |
Put the result of the process into a variable once
To make the meaning of assertion easier to understand,
Diffstat (limited to 'test/readline/test_readline.rb')
-rw-r--r-- | test/readline/test_readline.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 280c6ddb44..0a8971320b 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -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 |