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:13 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-06 17:16:13 +0000
commit5dbbfc3b3463d08b290e33975d815b6336069810 (patch)
tree9866e8e75c202c76cd80fe5fb56084960a4e4787 /test/ruby/test_lazy_enumerator.rb
parentc8426ce840bf5329fd31e8696d4f225a207b6550 (diff)
downloadruby-5dbbfc3b3463d08b290e33975d815b6336069810.tar.gz
* enumerator.c: Support for lazy.{map|flat_map|...}.size
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r--test/ruby/test_lazy_enumerator.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb
index 754b6aa8e0..8c03c700c3 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -328,5 +328,13 @@ EOS
lazy = [1, 2, 3].lazy
assert_equal 3, lazy.size
assert_equal 42, Enumerator.new(42){}.lazy.size
+ %i[map collect flat_map collect_concat].each do |m|
+ assert_equal 3, lazy.send(m){}.size
+ end
+ assert_equal 3, lazy.zip([4]).size
+ %i[select find_all reject take_while drop_while].each do |m|
+ assert_equal nil, lazy.send(m){}.size
+ end
+ assert_equal nil, lazy.grep(//).size
end
end