move tests to testament (#16101)
* move tests to testament * minor * fix random * disable test random
This commit is contained in:
parent
d306a04466
commit
cbc793b30b
56 changed files with 2205 additions and 2232 deletions
19
tests/stdlib/tenumerate.nim
Normal file
19
tests/stdlib/tenumerate.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import std/enumerate
|
||||
|
||||
let a = @[1, 3, 5, 7]
|
||||
|
||||
block:
|
||||
var res: seq[(int, int)]
|
||||
for i, x in enumerate(a):
|
||||
res.add (i, x)
|
||||
assert res == @[(0, 1), (1, 3), (2, 5), (3, 7)]
|
||||
block:
|
||||
var res: seq[(int, int)]
|
||||
for (i, x) in enumerate(a.items):
|
||||
res.add (i, x)
|
||||
assert res == @[(0, 1), (1, 3), (2, 5), (3, 7)]
|
||||
block:
|
||||
var res: seq[(int, int)]
|
||||
for i, x in enumerate(3, a):
|
||||
res.add (i, x)
|
||||
assert res == @[(3, 1), (4, 3), (5, 5), (6, 7)]
|
||||
Loading…
Add table
Add a link
Reference in a new issue