summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 10:14:22 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 10:14:22 +0000
commitd135138f9b7b64dc49025e27b5a7c9f97b11fa6d (patch)
treeb32059c69147749408f8e46d7cb91de8c49ff92c /test
parent032861ade7bdbe2c7e939b9b2995ed2ad1a1cdc6 (diff)
* enumerator.c (lazy_zip): rescue StopIteration returned by
Enumerator#next. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_lazy_enumerator.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb
index f6fc870fb6..7064f3b178 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -130,6 +130,12 @@ class TestLazyEnumerator < Test::Unit::TestCase
assert_equal(1, a.current)
end
+ def test_zip_short_arg
+ a = Step.new(1..5)
+ assert_equal([5, nil], a.zip("a".."c").last)
+ assert_equal([5, nil], a.lazy.zip("a".."c").force.last)
+ end
+
def test_zip_without_arg
a = Step.new(1..3)
assert_equal([1], a.zip.first)