mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
make some tests faster (#9413)
* remove duplicated slow test * smaller `convex hull` * smaller sleep * faster `trtree` * smaller sleep in `tfuturestream`
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
discard """
|
||||
output: '''true
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true'''
|
||||
output: '''
|
||||
'''
|
||||
|
||||
ccodeCheck: "\\i ! @'deepCopy(' .*"
|
||||
"""
|
||||
@@ -55,10 +51,10 @@ proc convex_hull[T](points: var seq[T], cmp: proc(x, y: T): int {.closure.}) : s
|
||||
ul[k] = spawn half[T](points, k == 0)
|
||||
result = concat(^ul[0], ^ul[1])
|
||||
|
||||
var s = map(toSeq(0..999999), proc(x: int): Point = (float(x div 1000), float(x mod 1000)))
|
||||
var s = map(toSeq(0..99999), proc(x: int): Point = (float(x div 1000), float(x mod 1000)))
|
||||
setMaxPoolSize 2
|
||||
|
||||
#echo convex_hull[Point](s, cmpPoint)
|
||||
for i in 0..5:
|
||||
echo convex_hull[Point](s, cmpPoint) ==
|
||||
@[(0.0, 0.0), (999.0, 0.0), (999.0, 999.0), (0.0, 999.0)]
|
||||
doAssert convex_hull[Point](s, cmpPoint) ==
|
||||
@[(0.0, 0.0), (99.0, 0.0), (99.0, 999.0), (0.0, 999.0)]
|
||||
|
||||
@@ -11,7 +11,7 @@ proc timer(d: int): int =
|
||||
#echo fmt"done {d}"
|
||||
return d
|
||||
|
||||
var durations = [1000, 2000, 3000, 4000, 5000]
|
||||
var durations = [1000, 1500, 2000, 2500, 3000]
|
||||
var tasks: seq[FlowVarBase] = @[]
|
||||
var results: seq[int] = @[]
|
||||
|
||||
@@ -27,9 +27,9 @@ while index != -1:
|
||||
|
||||
doAssert results.len == 5
|
||||
doAssert 1000 in results
|
||||
doAssert 1500 in results
|
||||
doAssert 2000 in results
|
||||
doAssert 2500 in results
|
||||
doAssert 3000 in results
|
||||
doAssert 4000 in results
|
||||
doAssert 5000 in results
|
||||
sync()
|
||||
echo "true"
|
||||
|
||||
Reference in New Issue
Block a user