Sha256: c1a6d87ee0faae9da13ad3022a2abf115182d7d61a502ed5d4e1765a23a0ac84

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/enumerable/self/combinations.rb
#
# Extracted Fri Sep 08 20:20:32 EDT 2006
# Unit Tools Reap Test Extractor
#

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.7.46 test/lib/facets/core/enumerable/self/test_combinations.rb