Skip to content

Commit ee7ef67

Browse files
committed
Added CartesianProduct.test.js
1 parent 6fff99d commit ee7ef67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Maths/test/CartesianProduct.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ describe('cartesianProduct', () => {
1111

1212
it('should calculate the product of two sets', () => {
1313
const product1 = cartesianProduct([1], [1])
14-
const product2 = cartesianProduct([1, 2], [3, 5])
14+
const product2 = cartesianProduct([1,2], [3])
15+
const product3 = cartesianProduct([1, 2], [3, 4])
1516

16-
expect(product1).toEqual([[1, 1]]);
17-
expect(product2).toEqual([[1, 3], [1, 5], [2, 3], [2, 5]])
17+
expect(product1).toEqual([[1, 1]])
18+
expect(product2).toEqual([[1, 3],[2, 3]])
19+
expect(product3).toEqual([[1, 3], [1, 4], [2, 3], [2, 4]])
1820
})
1921
})

0 commit comments

Comments
 (0)