Sha256: 203d7d781093d58174f718321b403aadff31c7263419b4cbfe6f6ca1138273a9
Contents?: true
Size: 400 Bytes
Versions: 6
Compression:
Stored size: 400 Bytes
Contents
$:.unshift File.join(File.dirname(__FILE__), "..", "lib") require "test/unit" require "enumerable_extensions" class TestEnumerableExtensions < Test::Unit::TestCase def test_cart_product a = [1,2] b = [3,4] products = [[1,3], [1,4], [2,3], [2,4]] results = Enumerable.cart_prod(a,b) assert_equal(4, results.size) products.each { |p| assert(results.include? p) } end end
Version data entries
6 entries across 6 versions & 2 rubygems