move rest of tests to testament (#16140)
* move rest of tests to testament * Update tests/stdlib/tsums.nim
This commit is contained in:
parent
c9a10bb9e4
commit
bc1db0d6f1
12 changed files with 228 additions and 233 deletions
|
|
@ -36,23 +36,3 @@ macro with*(arg: typed; calls: varargs[untyped]): untyped =
|
|||
|
||||
result = newNimNode(nnkStmtList, arg)
|
||||
underscoredCalls(result, calls, arg)
|
||||
|
||||
when isMainModule:
|
||||
type
|
||||
Foo = object
|
||||
col, pos: string
|
||||
name: string
|
||||
|
||||
proc setColor(f: var Foo; r, g, b: int) = f.col = $(r, g, b)
|
||||
proc setPosition(f: var Foo; x, y: float) = f.pos = $(x, y)
|
||||
|
||||
var f: Foo
|
||||
with(f, setColor(2, 3, 4), setPosition(0.0, 1.0))
|
||||
echo f
|
||||
|
||||
f = Foo()
|
||||
with f:
|
||||
col = $(2, 3, 4)
|
||||
pos = $(0.0, 1.0)
|
||||
_.name = "bar"
|
||||
echo f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue