summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-31 23:53:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-31 23:53:04 +0000
commitbd5d443a56ee4bcb59a0a08776c07dea3ee60121 (patch)
tree458d3bb53ff849b33bdfa42d666083dcc3c71fd5 /test/ruby
parentb1796737cf097ff7dc68b12ebb6d86a9528c95be (diff)
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/ruby')
-rw-r--r--test/ruby/test_lazy_enumerator.rb5
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)