Sha256: 24d184413d807b80eef2a7ef07abd9bc20fb1c3907ad42a56df6fc7689534ac9

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

require 'facets/ruby'
require 'test/unit'

class TestEnumerableProduct < Test::Unit::TestCase

  def test_product
    a = %w|a b|
    b = %w|a x|
    c = %w|x y|
    z = a.product(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

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.4.0 test/test_ruby/array/test_product.rb
facets-2.4.1 test/test_ruby/array/test_product.rb