diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:11:36 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:11:36 +0000 |
commit | 68c90c4a2d0b9431ad6f12ba12c91c7e3d65360d (patch) | |
tree | aa287401867b69d08566bf9c1d41b9543d08b6eb /test/ruby/test_enumerator.rb | |
parent | 6bbf668d6e797a402a3e6819f4efda5315db1a11 (diff) | |
download | ruby-68c90c4a2d0b9431ad6f12ba12c91c7e3d65360d.tar.gz |
* array.c (rb_ary_repeated_permutation): Support for repeated_permutation.size
[Feature #6636]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r-- | test/ruby/test_enumerator.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 90718b29cb..1c04a05bb0 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -446,6 +446,10 @@ class TestEnumerator < Test::Unit::TestCase assert_equal 28258808871162574166368460400, (1..100).to_a.combination(42).size # 1.upto(100).inject(:*) / 1.upto(42).inject(:*) / 1.upto(58).inject(:*) + + check_consistency_for_combinatorics(:repeated_permutation) + assert_equal 291733167875766667063796853374976, + (1..42).to_a.repeated_permutation(20).size # 42 ** 20 end end |