From c22b223cb0a48342cef7412e139313e60a913e71 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 6 Jun 2010 01:44:38 +0000 Subject: * array.c (rb_ary_product): need to set the length in order to get the entries marked. [ruby-dev:41540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_array.rb') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index fedcec71fc..0ee38a2b37 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1,4 +1,5 @@ require 'test/unit' +require_relative 'envutil' class TestArray < Test::Unit::TestCase def setup @@ -1515,6 +1516,13 @@ class TestArray < Test::Unit::TestCase @cls[1,2].product([3,4],[5,6])) assert_equal(@cls[[1],[2]], @cls[1,2].product) assert_equal(@cls[], @cls[1,2].product([])) + + bug3394 = '[ruby-dev:41540]' + acc = [] + EnvUtil.under_gc_stress {[1,2].product([3,4,5],[6,8]){|array| acc << array}} + assert_equal([[1, 3, 6], [1, 3, 8], [1, 4, 6], [1, 4, 8], [1, 5, 6], [1, 5, 8], + [2, 3, 6], [2, 3, 8], [2, 4, 6], [2, 4, 8], [2, 5, 6], [2, 5, 8]], + acc, bug3394) end def test_permutation -- cgit v1.2.3