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
This commit is contained in:
parent
8e9ab33988
commit
8cec0d5653
@ -1,5 +1,6 @@
|
|||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'thread'
|
require 'thread'
|
||||||
|
require_relative '../ruby/envutil'
|
||||||
|
|
||||||
class TestQueue < Test::Unit::TestCase
|
class TestQueue < Test::Unit::TestCase
|
||||||
def test_queue
|
def test_queue
|
||||||
@ -53,4 +54,20 @@ class TestQueue < Test::Unit::TestCase
|
|||||||
assert_raise(ArgumentError) { q.max = -1 }
|
assert_raise(ArgumentError) { q.max = -1 }
|
||||||
assert_equal(1, q.max)
|
assert_equal(1, q.max)
|
||||||
end
|
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
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user