aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_lazy_enumerator.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-06 17:16:29 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-06 17:16:29 +0000
commit9aafa954aa9ddb54f943c029100c03c4d4a1701b (patch)
tree33ea5c8b0e25107b4bb4f80934eaa575363138c3 /test/ruby/test_lazy_enumerator.rb
parent5dbbfc3b3463d08b290e33975d815b6336069810 (diff)
downloadruby-9aafa954aa9ddb54f943c029100c03c4d4a1701b.tar.gz
* enumerator.c: Support for lazy.take.size
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r--test/ruby/test_lazy_enumerator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb
index 8c03c700c3..e09c3af837 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -336,5 +336,10 @@ EOS
assert_equal nil, lazy.send(m){}.size
end
assert_equal nil, lazy.grep(//).size
+
+ assert_equal 2, lazy.take(2).size
+ assert_equal 3, lazy.take(4).size
+ assert_equal 4, loop.lazy.take(4).size
+ assert_equal nil, lazy.select{}.take(4).size
end
end