This project is closed and read-only.
Backport #7947 » queue_retval.patch
| lib/thread.rb (working copy) | ||
|---|---|---|
|
@que.push obj
|
||
|
@cond.signal
|
||
|
end
|
||
|
self
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
#
|
||
|
def clear
|
||
|
@que.clear
|
||
|
self
|
||
|
end
|
||
|
#
|
||
| ... | ... | |
|
@que.push obj
|
||
|
@cond.signal
|
||
|
end
|
||
|
self
|
||
|
end
|
||
|
end
|
||
| test/thread/test_queue.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
}
|
||
|
end
|
||
|
def test_queue_push_return_value
|
||
|
q = Queue.new
|
||
|
retval = q.push(1)
|
||
|
assert_same q, retval
|
||
|
end
|
||
|
def test_queue_clear_return_value
|
||
|
q = Queue.new
|
||
|
retval = q.clear
|
||
|
assert_same q, retval
|
||
|
end
|
||
|
def test_sized_queue_push_return_value
|
||
|
q = SizedQueue.new(1)
|
||
|
retval = q.push(1)
|
||
|
assert_same q, retval
|
||
|
end
|
||
|
def test_sized_queue_clear_return_value
|
||
|
q = SizedQueue.new(1)
|
||
|
retval = q.clear
|
||
|
assert_same q, retval
|
||
|
end
|
||
|
end
|
||