From 41d6ba8765f0d856ce5cca293531f717b068ee3f Mon Sep 17 00:00:00 2001 From: marcandre Date: Thu, 24 Jan 2013 06:24:22 +0000 Subject: * enumerator.c: Fix state handling for Lazy#zip [bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38923 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 2fdd854e8e..b626bc4753 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -264,6 +264,14 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal([*(6..10)]*5, drop5.flat_map{drop5}.force, bug7696) end + def test_zip_nested + bug7696 = '[ruby-core:51470]' + enum = ('a'..'z').each + enum.next + zip = (1..3).lazy.zip(enum, enum) + assert_equal([[1, 'a', 'a'], [2, 'b', 'b'], [3, 'c', 'c']]*3, zip.flat_map{zip}.force, bug7696) + end + def test_take_rewound bug7696 = '[ruby-core:51470]' e=(1..42).lazy.take(2) -- cgit v1.2.3