From 77a6c82eabe113802a52bf77b8b8a0bcfe1f28f4 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@13598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_array.rb') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 2e9c6fca57..6787d9c99c 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 v1.2.3