PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/array/permutation'
  2. require 'test/unit'
  3. require 'set'
  4. class TestEnumerablePermutation < Test::Unit::TestCase
  5. def test_permutation
  6. o = Set.new
  7. %w[a b c].permutation{ |x| o << x.join('') }
  8. r = Set.new(['abc','acb','bac','bca','cab','cba'])
  9. assert_equal( r, o )
  10. end
  11. end