mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
032861ade7
commit
d135138f9b
3 changed files with 25 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue