/vendor/gems/facets-2.4.5/test/core/array/test_permutation.rb
https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 14 lines · 11 code · 3 blank · 0 comment · 0 complexity · 37b271df53392e7faea47100232eb664 MD5 · raw file
- require 'facets/array/permutation'
- require 'test/unit'
- require 'set'
- class TestEnumerablePermutation < Test::Unit::TestCase
- def test_permutation
- o = Set.new
- %w[a b c].permutation{ |x| o << x.join('') }
- r = Set.new(['abc','acb','bac','bca','cab','cba'])
- assert_equal( r, o )
- end
- end