ruby-changes:67120
From: aycabta <ko1@a...>
Date: Wed, 11 Aug 2021 14:11:49 +0900 (JST)
Subject: [ruby-changes:67120] 4f324514aa (master): Put the result of the process into a variable once
https://git.ruby-lang.org/ruby.git/commit/?id=4f324514aa From 4f324514aa5b3dd598f31cf41602dd414e0fbaca Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Wed, 11 Aug 2021 14:07:28 +0900 Subject: Put the result of the process into a variable once To make the meaning of assertion easier to understand, --- test/readline/test_readline.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 280c6dd..0a89713 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -539,18 +539,20 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L539 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 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/