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

ruby-changes:67121

From: aycabta <ko1@a...>
Date: Wed, 11 Aug 2021 14:11:49 +0900 (JST)
Subject: [ruby-changes:67121] c59da370a5 (master): Add comments about testing steps

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

From c59da370a5d10ccecf3410a80b3d3af631e31df7 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 11 Aug 2021 14:08:39 +0900
Subject: Add comments about testing steps

---
 test/readline/test_readline.rb | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 0a89713..1ce0e3b 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -496,18 +496,20 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L496
         end
       }
       Readline.input = STDIN
+      # 0. Send SIGINT to this script.
       begin
         Thread.new{
           trap(:INT) {
-            puts 'TRAP'
+            puts 'TRAP' # 2. Show 'TRAP' message.
           }
-          Readline.readline('input> ')
+          Readline.readline('input> ') # 1. Should keep working and call old trap.
+                                       # 4. Receive "\\n" and return because still working.
         }.value
       rescue Interrupt
-        puts 'FAILED'
+        puts 'FAILED' # 3. "Interrupt" shouldn't be raised because trapped.
         raise
       end
-      puts 'SUCCEEDED'
+      puts 'SUCCEEDED' # 5. Finish correctly.
     end;
 
     script = Tempfile.new("interrupt_in_other_thread")
-- 
cgit v1.1


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

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