22 lines
438 B
Nim
22 lines
438 B
Nim
import ../src/ndspkg/types/ndlist
|
|
|
|
proc testNdlist* =
|
|
var list = newList[int]()
|
|
|
|
var simlen = 0 # simulated length
|
|
|
|
for i in countup(0, 10000):
|
|
assert list.getLength() == simlen
|
|
list.add(i)
|
|
simlen.inc
|
|
assert list.getLength() == simlen
|
|
assert list.getIndex(i) == i
|
|
list.setIndex(i, i*2)
|
|
assert list.getLength() == simlen
|
|
assert list.getIndex(i) == i * 2
|
|
|
|
|
|
list.free()
|
|
|
|
echo "ndlist test finished"
|