mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 19:22:40 +00:00
This test runtime tends to hover around the 5s mark depending on how loaded the system currently is. This causes the test to fail a lot during CI, per analytics: https://dev.azure.com/nim-lang/Nim/_test/analytics?definitionId=1&contextType=build Give the test an extra 2 seconds to account for unrelated overhead.
31 lines
415 B
Nim
31 lines
415 B
Nim
discard """
|
|
timeout: "7"
|
|
action: "compile"
|
|
nimout: '''create
|
|
search
|
|
done'''
|
|
"""
|
|
|
|
# bug #12195
|
|
|
|
import tables
|
|
|
|
type Flop = object
|
|
a: array[128, int] # <-- compile time is proportional to array size
|
|
|
|
proc hop(): bool =
|
|
var v: Table[int, Flop]
|
|
|
|
echo "create"
|
|
for i in 1..1000:
|
|
v.add i, Flop()
|
|
|
|
echo "search"
|
|
for i in 1..1000:
|
|
discard contains(v, i)
|
|
|
|
echo "done"
|
|
|
|
const r {.used.} = hop()
|
|
|