diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:13:19 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:13:19 +0000 |
commit | cef054d5b2d29422b2160783aea6d0581c701483 (patch) | |
tree | 12a0e7ebc3a2ea1196bfa6b0c7d3a38e69f4875d /test/ruby/test_enumerator.rb | |
parent | fe9386cdcbfce8c631a333add2b2cab8366ee6dc (diff) | |
download | ruby-cef054d5b2d29422b2160783aea6d0581c701483.tar.gz |
* enum.c (enum_cycle): Support for Enumerable#cycle.size
[Feature #6636]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r-- | test/ruby/test_enumerator.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index a8564c1ce0..66d5e28a14 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -477,6 +477,11 @@ class TestEnumerator < Test::Unit::TestCase assert_equal 0, [:foo, :bar].cycle(-10).size assert_equal 0, [].cycle.size assert_equal 0, [].cycle(5).size + + assert_equal nil, @obj.cycle.size + assert_equal nil, @obj.cycle(5).size + assert_equal Float::INFINITY, @sized.cycle.size + assert_equal 126, @sized.cycle(3).size end def test_size_for_loops |