[前][次][番号順一覧][スレッド一覧]

ruby-changes:67119

From: aycabta <ko1@a...>
Date: Wed, 11 Aug 2021 14:11:48 +0900 (JST)
Subject: [ruby-changes:67119] 67e06102a3 (master): Stop checking char from "read"

https://git.ruby-lang.org/ruby.git/commit/?id=67e06102a3

From 67e06102a3c8d0b8e8ff7a6f0528016f2560fd4b Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 10 Aug 2021 06:54:32 +0900
Subject: Stop checking char from "read"

Because it's sometimes nil due to race condition.
---
 test/readline/test_readline.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 3661aac..c0f1b30 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -520,14 +520,16 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L520
     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 https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L539
         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----"
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]