diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-31 23:53:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-31 23:53:04 +0000 |
commit | 34cacd05816a10da27378d7fd5e1d0ff283a8931 (patch) | |
tree | 458d3bb53ff849b33bdfa42d666083dcc3c71fd5 /test | |
parent | 0b2d86c642991214a9361e348f0eeae0c7f47023 (diff) | |
download | ruby-34cacd05816a10da27378d7fd5e1d0ff283a8931.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 5feddd5bde..792a95bb7e 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -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) |