summaryrefslogtreecommitdiff
path: root/test/thread
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-14 00:23:43 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-14 00:23:43 +0000
commit8cec0d5653110b5dd4c7484b13c561bc1cbb950d (patch)
treef0a7fcf4f8a89fd47c93c4fc923cddde16571493 /test/thread
parent8e9ab339881873bba8889fef7210cf47d9892510 (diff)
Add test for [Bug #5343] [ruby-core:39634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/thread')
-rw-r--r--test/thread/test_queue.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index 685b41a..1dfcd07 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -1,5 +1,6 @@
require 'test/unit'
require 'thread'
+require_relative '../ruby/envutil'
class TestQueue < Test::Unit::TestCase
def test_queue
@@ -53,4 +54,20 @@ class TestQueue < Test::Unit::TestCase
assert_raise(ArgumentError) { q.max = -1 }
assert_equal(1, q.max)
end
+
+ def test_thr_kill
+ bug5343 = '[ruby-core:39634]'
+ assert_normal_exit(<<-'_eom', bug5343)
+ require "thread"
+ queue = Queue.new
+ r, w = IO.pipe
+ th = Thread.start {
+ queue.push(nil)
+ r.read 1
+ }
+ queue.pop
+ th.kill.join
+ _eom
+ end
+
end