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
|
|
@ -68,22 +68,3 @@ macro enumerate*(x: ForLoopStmt): untyped {.since: (1, 3).} =
|
|||
result.add newFor
|
||||
# now wrap the whole macro in a block to create a new scope
|
||||
result = newBlockStmt(result)
|
||||
|
||||
when isMainModule:
|
||||
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