summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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 72fe1a4..caa9a9c 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -452,6 +452,14 @@ class TestLazyEnumerator < Test::Unit::TestCase
EOS
end
+ def test_lazy_eager
+ lazy = [1, 2, 3].lazy.map { |x| x * 2 }
+ enum = lazy.eager
+ assert_equal Enumerator, enum.class
+ assert_equal 3, enum.size
+ assert_equal [1, 2, 3], enum.map { |x| x / 2 }
+ end
+
def test_lazy_to_enum
lazy = [1, 2, 3].lazy
def lazy.foo(*args)