mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
removed unittest from talgorithm
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
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]]
|
||||
doAssert product[int](newSeq[seq[int]]()) == newSeq[seq[int]](), "empty input"
|
||||
doAssert product[int](@[newSeq[int](), @[], @[]]) == newSeq[seq[int]](), "bit more empty input"
|
||||
doAssert product(@[@[1,2]]) == @[@[1,2]], "a simple case of one element"
|
||||
doAssert product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]], "two elements"
|
||||
doAssert 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]], "three elements"
|
||||
doAssert product(@[@[1,2], @[]]) == newSeq[seq[int]](), "two elements, but one empty"
|
||||
|
||||
Reference in New Issue
Block a user