From 5dbbfc3b3463d08b290e33975d815b6336069810 Mon Sep 17 00:00:00 2001 From: marcandre Date: Tue, 6 Nov 2012 17:16:13 +0000 Subject: * 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 --- test/ruby/test_lazy_enumerator.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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 -- cgit v1.2.1