PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms 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
 1require 'facets/array/permutation'
 2require 'test/unit'
 3require 'set'
 4
 5class TestEnumerablePermutation < Test::Unit::TestCase
 6
 7  def test_permutation
 8    o = Set.new
 9    %w[a b c].permutation{ |x| o << x.join('') }
10    r = Set.new(['abc','acb','bac','bca','cab','cba'])
11    assert_equal( r, o )
12  end
13
14end