diff options
author | Simon Hafner <hafnersimon@gmail.com> | 2014-01-30 23:55:43 -0600 |
---|---|---|
committer | Simon Hafner <hafnersimon@gmail.com> | 2014-01-30 23:55:43 -0600 |
commit | e01fb17d023b046b3403a4413a637d24a9dc492f (patch) | |
tree | c28b802bb6eb52ce152367a728ab260526c69b19 /tests/stdlib | |
parent | f070edb8b91d07bd4ac8fea82317b906cc5ec1c9 (diff) | |
download | Nim-e01fb17d023b046b3403a4413a637d24a9dc492f.tar.gz |
product more robust against empty input
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/talgorithm.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim index ea57883b0..37de1262f 100644 --- a/tests/stdlib/talgorithm.nim +++ b/tests/stdlib/talgorithm.nim @@ -1,6 +1,11 @@ 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": |