Sha256: 8b2dacceca4431322bb69dca28eba70190f505fceaa650d90ade12a58275f417

Contents?: true

Size: 909 Bytes

Versions: 1

Compression:

Stored size: 909 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/enumerable/self/combinations.rb
#
# Extracted Fri Feb 16 02:00:36 EST 2007
# Project.rb Test Extraction
#

require 'facets/core/enumerable/self/combinations.rb'


  require 'test/unit'

  class TCEnumerable < Test::Unit::TestCase

    def test_01
      a = [1,2]
      b = [3,4]
      z = Enumerable.combinations(a,b)
      r = [[1,3],[1,4],[2,3],[2,4]]
      assert_equal( r, z )
    end

    def test_02
      a = %w|a b|
      b = %w|a x|
      c = %w|x y|
      z = Enumerable.combinations(a, b, c)
      r = [ ["a", "a", "x"],
            ["a", "a", "y"],
            ["a", "x", "x"],
            ["a", "x", "y"],
            ["b", "a", "x"],
            ["b", "a", "y"],
            ["b", "x", "x"],
            ["b", "x", "y"] ]
      assert_equal( r, z )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.8.49 test/lib/facets/core/enumerable/self/test_combinations.rb