From 3089f1411ae7fbe2c1e38afacae0c2df32dcc8b8 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 2 Oct 2007 03:33:53 +0000 Subject: * array.c (rb_ary_product): generalized product, now takes arbitrary number of arrays. a patch from David Flanagan . [ruby-core:12346] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 2e9c6fca5..6787d9c99 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1190,6 +1190,12 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]], @cls[1,2,3].product([4,5])) assert_equal(@cls[[1,1],[1,2],[2,1],[2,2]], @cls[1,2].product([1,2])) + + assert_equal(@cls[[1,3,5],[1,3,6],[1,4,5],[1,4,6], + [2,3,5],[2,3,6],[2,4,5],[2,4,6]], + @cls[1,2].product([3,4],[5,6])) + assert_equal(@cls[[1],[2]], @cls[1,2].product) + assert_equal(@cls[], @cls[1,2].product([])) end def test_permutation -- cgit