Sha256: 9b57c9fc1f1491adba519f52f5fa3cc849d2e074a71de9be7c1fc0e786cc1648

Contents?: true

Size: 369 Bytes

Versions: 13

Compression:

Stored size: 369 Bytes

Contents

require 'facets/enumerable/commonality.rb'
require 'test/unit'

class Test_Enumerable_Commonality < Test::Unit::TestCase

  def test_commonality
    a = [1,2,2,3,3,3]
    r = { 2 => [2,2], 3 => [3,3,3] }
    assert_equal( r, a.commonality )
    a = [1,2,2,3,3,3]
    r = {false=>[1, 2, 2], true=>[3, 3, 3]}
    assert_equal( r, a.commonality { |x| x > 2 } )
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/enumerable/test_commonality.rb
facets-2.8.3 test/core/enumerable/test_commonality.rb
facets-2.8.2 test/core/enumerable/test_commonality.rb
facets-2.8.1 test/core/enumerable/test_commonality.rb
facets-2.8.0 test/core/enumerable/test_commonality.rb
facets-2.7.0 test/core/enumerable/test_commonality.rb
facets-2.6.0 test/core/enumerable/test_commonality.rb
facets-2.4.4 test/core/enumerable/test_commonality.rb
facets-2.4.3 test/core/enumerable/test_commonality.rb
facets-2.4.5 test/core/enumerable/test_commonality.rb
facets-2.5.1 test/core/enumerable/test_commonality.rb
facets-2.5.0 test/core/enumerable/test_commonality.rb
facets-2.5.2 test/core/enumerable/test_commonality.rb