summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-12 15:28:56 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-12 15:28:56 +0000
commitba76a79a3eeba71cc3d6ea952521e42415b025a6 (patch)
tree5340825763fc0fb2fd63e72a99281d914e6565ec /test
parent45ce46087aa6666809cc0b213bc89837dae4bb39 (diff)
merge revision(s) 42450: [Backport #8735]
* 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/branches/ruby_2_0_0@42922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_lazy_enumerator.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb
index 22c39954ce..6548c35dba 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -292,6 +292,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)