mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 05:55:46 +02:00
Add comments about testing steps
This commit is contained in:
parent
4f324514aa
commit
c59da370a5
1 changed files with 6 additions and 4 deletions
|
@ -496,18 +496,20 @@ module BasetestReadline
|
|||
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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue