diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-24 06:24:22 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-24 06:24:22 +0000 |
commit | 41d6ba8765f0d856ce5cca293531f717b068ee3f (patch) | |
tree | 0b0ff04b3bc9c588bbe058f0fab2c2deb9eaf3fe /test/ruby/test_lazy_enumerator.rb | |
parent | 9d94a1a5a18f80974e017cb81790a08dad84faef (diff) |
* 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
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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) |