summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 19:18:54 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 19:18:54 +0000
commit3a3e250975d0ce34b0e5628a2fc2a3bfa7722188 (patch)
treea9f5cc6aa90562d1449295970feae2c07ec9eef8 /test/ruby/test_array.rb
parentcd5eb03b58f270cd1200a9914103a0b6a19b9397 (diff)
* enum.c (enum_count, count_all_i, Init_Enumerable),
array.c (rb_ary_count): If no argument or block is given, count the number of all elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 035b70ad2a..877df749f8 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -539,6 +539,7 @@ class TestArray < Test::Unit::TestCase
def test_count
a = @cls[1, 2, 3, 1, 2]
+ assert_equal(5, a.count)
assert_equal(2, a.count(1))
assert_equal(3, a.count {|x| x % 2 == 1 })
assert_equal(2, a.count(1) {|x| x % 2 == 1 })