mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00
* enum.c (enum_each_cons): Support for Enumerable#each_cons.size
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df8451e606
commit
fe9386cdcb
2 changed files with 22 additions and 1 deletions
|
@ -490,5 +490,12 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
assert_equal 1, @sized.each_slice(70).size
|
||||
assert_raise(ArgumentError){ @obj.each_slice(0).size }
|
||||
end
|
||||
|
||||
def test_size_for_each_cons
|
||||
assert_equal nil, @obj.each_cons(3).size
|
||||
assert_equal 33, @sized.each_cons(10).size
|
||||
assert_equal 0, @sized.each_cons(70).size
|
||||
assert_raise(ArgumentError){ @obj.each_cons(0).size }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue