diff options
Diffstat (limited to 'test/thread/test_queue.rb')
-rw-r--r-- | test/thread/test_queue.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index e1ead47197..51da231736 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -74,6 +74,13 @@ class TestQueue < Test::Unit::TestCase assert_equal(0, q.num_waiting) end + def test_queue_pop_non_block + q = Queue.new + assert_raise_with_message(ThreadError, /empty/) do + q.pop(true) + end + end + def test_sized_queue_pop_interrupt q = SizedQueue.new(1) t1 = Thread.new { q.pop } @@ -82,6 +89,13 @@ class TestQueue < Test::Unit::TestCase assert_equal(0, q.num_waiting) end + def test_sized_queue_pop_non_block + q = SizedQueue.new(1) + assert_raise_with_message(ThreadError, /empty/) do + q.pop(true) + end + end + def test_sized_queue_push_interrupt q = SizedQueue.new(1) q.push(1) |