diff options
Diffstat (limited to 'tests/stdlib/twith.nim')
-rw-r--r-- | tests/stdlib/twith.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/stdlib/twith.nim b/tests/stdlib/twith.nim index 80382f7c4..ceadbe7bf 100644 --- a/tests/stdlib/twith.nim +++ b/tests/stdlib/twith.nim @@ -1,4 +1,9 @@ +discard """ + matrix: "--mm:refc; --mm:orc" +""" + import std/with +import std/[assertions, formatfloat] type Foo = object @@ -21,3 +26,19 @@ with f: doAssert f.col == "(2, 3, 4)" doAssert f.pos == "(0.0, 1.0)" doAssert f.name == "bar" + +type + Baz* = object + a*, b*: int + Bar* = object + x*: int + baz*: Baz + +var bar: Bar +with bar: + x = 1 + with baz: + a = 2 + +doAssert bar.x == 1 +doAssert bar.baz.a == 2 |