Sha256: 99623259c7e7088db9c2911f2675d017dbd26fc993444c538eeda023bc472128

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/nano/enumerable/self/combinations.rb
#
# Extracted Fri Oct 28 14:20:18 EDT 2005
# Unit Tools Reap Test Extractor
#

require 'nano/enumerable/self/combinations.rb'


  require 'test/unit'

  class TCEnumerable < Test::Unit::TestCase

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

      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"] ]
      a = %w|a b|
      b = %w|a x|
      c = %w|x y|
      z = Enumerable.combinations(a, b, c)
      assert_equal( r, z )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-0.9.0 test/lib/nano/enumerable/self/test_combinations.rb