diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-08 15:10:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-08 15:10:37 +0000 |
commit | 8d644d6a6e578bab91c6b0029b492673090751d4 (patch) | |
tree | 483a1243a755cf903b9a439284a6fbb84eb33158 /test | |
parent | a25d02b144c9560dc3d1139a4a0024b6ade6e21c (diff) | |
download | ruby-8d644d6a6e578bab91c6b0029b492673090751d4.tar.gz |
enumerator.c: fix non-single argument
* enumerator.c (lazy_zip_func): fix non-single argument. fix
out-of-bound access and pack multiple yielded values.
[ruby-core:56383] [Bug #8735]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 1108b93706..760db95f7b 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -298,6 +298,18 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal [[1, 42], [2, :foo]], zip.force end + def test_zip_nonsingle + bug8735 = '[ruby-core:56383] [Bug #8735]' + + obj = Object.new + def obj.each + yield + yield 1, 2 + end + + assert_equal(obj.to_enum.zip(obj.to_enum), obj.to_enum.lazy.zip(obj.to_enum).force, bug8735) + end + def test_take_rewound bug7696 = '[ruby-core:51470]' e=(1..42).lazy.take(2) |