Sha256: fca9cd7877f82d81a84a1456bffa8e0caebd992c8af2251f329a262971a6efd6
Contents?: true
Size: 875 Bytes
Versions: 1
Compression:
Stored size: 875 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facet/enumerable/self/combinations.rb # # Extracted Wed Jan 25 11:25:39 EST 2006 # Unit Tools Reap Test Extractor # require 'facet/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-1.0.3 | packages/core/test/lib/facet/enumerable/self/test_combinations.rb |