summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-02 00:45:47 +0100
committerAraq <rumpf_a@web.de>2014-02-02 00:45:47 +0100
commitefcbaa965e84588c8ff9ed5a62b79820dd5ea5ca (patch)
treee64c2adccb071a06e6be6a0103a1c6433236bb98 /tests
parentd29aa4c5ac6950a9b8c53bedeb9dd0dd9b4f64a2 (diff)
parentf9c2ec8d9238afaff285b2ba286f8c5534b05eec (diff)
downloadNim-efcbaa965e84588c8ff9ed5a62b79820dd5ea5ca.tar.gz
remove the old tester
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/talgorithm.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim
new file mode 100644
index 000000000..37de1262f
--- /dev/null
+++ b/tests/stdlib/talgorithm.nim
@@ -0,0 +1,14 @@
+import unittest
+import algorithm
+
+suite "product":
+  test "empty input":
+    check product[int](newSeq[seq[int]]()) == newSeq[seq[int]]()
+  test "bit more empty input":
+    check product[int](@[newSeq[int](), @[], @[]]) == newSeq[seq[int]]()
+  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]]