* array.c (rb_ary_product): Don't limit based on size when a block is given

cf [ruby-core:29240]

* test/ruby/test_array.rb (class): Test for above

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2010-04-03 20:59:56 +00:00
parent 88a4bf912d
commit 93f4317f89
2 changed files with 26 additions and 16 deletions

View file

@ -1850,7 +1850,10 @@ class TestArray < Test::Unit::TestCase
def test_product2
a = (0..100).to_a
assert_raise(RangeError) do
a.product(a, a, a, a, a, a, a, a, a, a) {}
a.product(a, a, a, a, a, a, a, a, a, a)
end
assert_nothing_raised(RangeError) do
a.product(a, a, a, a, a, a, a, a, a, a) { break }
end
end