diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:11:21 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:11:21 +0000 |
commit | 6bbf668d6e797a402a3e6819f4efda5315db1a11 (patch) | |
tree | 40b0626cab9471f87a9f738e212d759f7219d2b3 /test/ruby | |
parent | 1cb9f27c13481594469948ddbca982dd5ae4fad8 (diff) |
* array.c (rb_ary_combination): Support for Array#combination.size
[Feature #6636]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_enumerator.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index a4222f2ac0..90718b29cb 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -441,6 +441,11 @@ class TestEnumerator < Test::Unit::TestCase assert_equal 24, [0, 1, 2, 4].permutation.size assert_equal 2933197128679486453788761052665610240000000, (1..42).to_a.permutation(30).size # 1.upto(42).inject(:*) / 1.upto(12).inject(:*) + + check_consistency_for_combinatorics(:combination) + assert_equal 28258808871162574166368460400, + (1..100).to_a.combination(42).size + # 1.upto(100).inject(:*) / 1.upto(42).inject(:*) / 1.upto(58).inject(:*) end end |