fedora-migrator /vendor/gems/facets-2.4.5/test/core/array/test_permutation.rb

Language Ruby Lines 15
MD5 Hash 37b271df53392e7faea47100232eb664 Estimated Cost $237 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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
Back to Top