less test time costs (#20479)
This commit is contained in:
parent
1737bb9f9e
commit
0769b160c5
3 changed files with 8 additions and 12 deletions
|
|
@ -177,16 +177,14 @@ block tableconstr:
|
||||||
block ttables2:
|
block ttables2:
|
||||||
proc TestHashIntInt() =
|
proc TestHashIntInt() =
|
||||||
var tab = initTable[int,int]()
|
var tab = initTable[int,int]()
|
||||||
let n = 100_000
|
let n = 10
|
||||||
for i in 1..n:
|
for i in 1..n:
|
||||||
tab[i] = i
|
tab[i] = i
|
||||||
for i in 1..n:
|
for i in 1..n:
|
||||||
var x = tab[i]
|
var x = tab[i]
|
||||||
if x != i : echo "not found ", i
|
if x != i : echo "not found ", i
|
||||||
|
|
||||||
proc run1() =
|
TestHashIntInt()
|
||||||
for i in 1 .. 50:
|
|
||||||
TestHashIntInt()
|
|
||||||
|
|
||||||
# bug #2107
|
# bug #2107
|
||||||
|
|
||||||
|
|
@ -198,7 +196,6 @@ block ttables2:
|
||||||
delTab[5] = 5
|
delTab[5] = 5
|
||||||
|
|
||||||
|
|
||||||
run1()
|
|
||||||
echo "2"
|
echo "2"
|
||||||
|
|
||||||
block tablesref:
|
block tablesref:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''
|
output: '''
|
||||||
312
|
312
|
||||||
1000000
|
1000
|
||||||
1000000
|
1000
|
||||||
500000
|
500
|
||||||
0
|
0
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
@ -445,7 +445,7 @@ proc test() =
|
||||||
var it1 = internalFind(root, 312)
|
var it1 = internalFind(root, 312)
|
||||||
echo it1.value
|
echo it1.value
|
||||||
|
|
||||||
for i in 1..1_000_000:
|
for i in 1..1_000:
|
||||||
root = internalPut(root, i, i, oldvalue)
|
root = internalPut(root, i, i, oldvalue)
|
||||||
|
|
||||||
var cnt = 0
|
var cnt = 0
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import unittest
|
|
||||||
|
|
||||||
type Obj = object
|
type Obj = object
|
||||||
foo: int
|
foo: int
|
||||||
|
|
@ -10,9 +9,9 @@ block: # object basic methods
|
||||||
block: # it should convert an object to a string
|
block: # it should convert an object to a string
|
||||||
var obj = makeObj(1)
|
var obj = makeObj(1)
|
||||||
# Should be "obj: (foo: 1)" or similar.
|
# Should be "obj: (foo: 1)" or similar.
|
||||||
check($obj == "(foo: 1)")
|
doAssert($obj == "(foo: 1)")
|
||||||
block: # it should test equality based on fields
|
block: # it should test equality based on fields
|
||||||
check(makeObj(1) == makeObj(1))
|
doAssert(makeObj(1) == makeObj(1))
|
||||||
|
|
||||||
# bug #10203
|
# bug #10203
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue