diff options
Diffstat (limited to 'test/readline')
-rw-r--r-- | test/readline/test_readline.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 3661aace15..c0f1b30925 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -520,14 +520,16 @@ module BasetestReadline EnvUtil.invoke_ruby(["-I#{__dir__}", script.path], "", true, :merge_to_stdout) do |_in, _out, _, pid| Timeout.timeout(TIMEOUT) do log << "** START **" - while c = _out.read(1) + loop do + c = _out.read(1) log << c if c break if log.include?('input>') end log << "** SIGINT **" Process.kill(:INT, pid) sleep 0.1 - while c = _out.read(1) + loop do + c = _out.read(1) log << c if c break if log.include?('TRAP') end @@ -537,7 +539,8 @@ module BasetestReadline rescue Errno::EPIPE # The "write" will fail if Reline crashed by SIGINT. end - while c = _out.read(1) + 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----" |