summaryrefslogtreecommitdiff
path: root/test/ruby/test_thread.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-11-08 13:35:37 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-11-09 12:25:35 +0900
commitc3de7a3c58bf9a138ff8720ed56c0045d2b8e01d (patch)
treefa94950f00752f88d9284d5fc34071251168b514 /test/ruby/test_thread.rb
parent558137d5f3b77294949bd042bb99ae12d37faa2f (diff)
Make pending_interrupt?(Exception) work
A patch from katsu (Katsuhiro Ueno) [Bug #19110]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6689
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r--test/ruby/test_thread.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index f6156a16fd..8ca23e7d02 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1515,4 +1515,12 @@ q.pop
end
};
end
+
+ def test_pending_interrupt?
+ t = Thread.handle_interrupt(Exception => :never) { Thread.new { Thread.stop } }
+ t.raise(StandardError)
+ assert_equal(true, t.pending_interrupt?)
+ assert_equal(true, t.pending_interrupt?(Exception))
+ assert_equal(false, t.pending_interrupt?(ArgumentError))
+ end
end