diff options
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/talgorithm.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim new file mode 100644 index 000000000..ea57883b0 --- /dev/null +++ b/tests/stdlib/talgorithm.nim @@ -0,0 +1,9 @@ +import unittest + +suite "product": + test "a simple case of one element": + check product(@[@[1,2]]) == @[@[1,2]] + test "two elements": + check product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]] + test "three elements": + check product(@[@[1,2], @[3,4], @[5,6]]) == @[@[2,4,6],@[1,4,6],@[2,3,6],@[1,3,6], @[2,4,5],@[1,4,5],@[2,3,5],@[1,3,5]] |