diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-11-28 03:47:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 20:47:49 +0100 |
commit | bc1db0d6f163e4aba51f27b2a8cefd05476bd5e4 (patch) | |
tree | 48887ae1fd2a47553aa53f176adc14f7d1876ffc /lib/std/with.nim | |
parent | c9a10bb9e47c5227b32f49f5876e965cc2308541 (diff) | |
download | Nim-bc1db0d6f163e4aba51f27b2a8cefd05476bd5e4.tar.gz |
move rest of tests to testament (#16140)
* move rest of tests to testament * Update tests/stdlib/tsums.nim
Diffstat (limited to 'lib/std/with.nim')
-rw-r--r-- | lib/std/with.nim | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/std/with.nim b/lib/std/with.nim index ea26065a1..e6784478c 100644 --- a/lib/std/with.nim +++ b/lib/std/with.nim @@ -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 |