Add test for Enumerator::Lazy#take

* test/ruby/test_lazy_enumerator.rb (test_take_bad_arg): Add test
  code in case of Enumerator::Lazy#take called with negative number.
  [ruby-dev:49467] [Bug #11933]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-31 23:53:04 +00:00
parent b1796737cf
commit bd5d443a56
2 changed files with 11 additions and 0 deletions

View file

@ -275,6 +275,11 @@ class TestLazyEnumerator < Test::Unit::TestCase
assert_equal(nil, a.current)
end
def test_take_bad_arg
a = Step.new(1..10)
assert_raise(ArgumentError) { a.lazy.take(-1) }
end
def test_take_recycle
bug6428 = '[ruby-dev:45634]'
a = Step.new(1..10)