added a testcase for #12195; testament now supports a 'timeout' spec field

This commit is contained in:
Araq 2019-09-17 10:42:07 +02:00 • committed by Andreas Rumpf
commit c9f3a8b269
5 changed files with 52 additions and 1 deletions

31
tests/vm/tslow_tables.nim Normal file
View file

@ -0,0 +1,31 @@
discard """
timeout: "4"
action: "compile"
nimout: '''create
search
done'''
"""
# bug #12195
import tables
type Flop = object
a: int
#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 = hop()