summaryrefslogtreecommitdiff
path: root/test/thread
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 23:01:21 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 23:01:21 +0000
commit1c47bd88c13a19ce0b0a184d6e552f4d26433ac4 (patch)
tree79c22aff900518bb4e2f2de30ffe23f8397a9363 /test/thread
parent0b1ff939455a96bb2e715d029c0d412af8de593a (diff)
* lib/thread.rb (Queue#push): return self.
* lib/thread.rb (Queue#clear): ditto. * lib/thread.rb (SizedQueue#push): ditto. * test/thread/test_queue.rb: add tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/thread')
-rw-r--r--test/thread/test_queue.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index 993514f..24465e0 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -108,4 +108,29 @@ class TestQueue < Test::Unit::TestCase
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