Sha256: bff7c839cf958e98d05d15f4bb31c8033f19fec281cce2b47416f77d36441947
Contents?: true
Size: 887 Bytes
Versions: 1
Compression:
Stored size: 887 Bytes
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/facets/core/enumerable/self/combinations.rb # # Extracted Tue Jun 06 09:30:19 EDT 2006 # Unit Tools Reap Test Extractor # require 'facets/core/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.4.1 | test/lib/facets/core/enumerable/self/test_combinations.rb |