mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-31 04:29:02 +00:00
product more robust against empty input
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user