diff options
author | metagn <metagngn@gmail.com> | 2023-06-06 07:54:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 06:54:07 +0200 |
commit | b97d603cd00a210547bda1a2a1c3e09f97fcc49e (patch) | |
tree | 080b4ad7b5826b88a9483c6a0e4d697096f12cc1 /tests/misc/tlocals.nim | |
parent | 2ab948ce53e3d9b80bf9b02644c8ec8991f34d0a (diff) | |
download | Nim-b97d603cd00a210547bda1a2a1c3e09f97fcc49e.tar.gz |
some test cleanups & category reorganization (#22010)
* clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
Diffstat (limited to 'tests/misc/tlocals.nim')
-rw-r--r-- | tests/misc/tlocals.nim | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/misc/tlocals.nim b/tests/misc/tlocals.nim deleted file mode 100644 index e59976102..000000000 --- a/tests/misc/tlocals.nim +++ /dev/null @@ -1,76 +0,0 @@ -discard """ - matrix: "--mm:refc; --mm:orc" - output: '''(x: "string here", a: 1) -b is 5 -x is 12''' -""" - -proc simple[T](a: T) = - var - x = "string here" - echo locals() - -simple(1) - -type Foo2[T]=object - a2: T - -proc numFields*(T: typedesc[tuple|object]): int= - var t:T - for _ in t.fields: inc result - -proc test(baz: int, qux: var int): int = - var foo: Foo2[int] - let bar = "abc" - let c1 = locals() - doAssert numFields(c1.foo.type) == 1 - doAssert c1.bar == "abc" - doAssert c1.baz == 123 - doAssert c1.result == 0 - doAssert c1.qux == 456 - -var x1 = 456 -discard test(123, x1) - -# bug #11958 -proc foo() = - var a = 5 - proc bar() {.nimcall.} = - var b = 5 - for k, v in fieldpairs(locals()): - echo k, " is ", v - - bar() -foo() - - -proc foo2() = - var a = 5 - proc bar2() {.nimcall.} = - for k, v in fieldpairs(locals()): - echo k, " is ", v - - bar2() -foo2() - - -proc foo3[T](y: T) = - var a = 5 - proc bar2[T](x: T) {.nimcall.} = - for k, v in fieldpairs(locals()): - echo k, " is ", v - - bar2(y) - -foo3(12) - -block: # bug #12682 - template foo(): untyped = - var c1 = locals() - 1 - - proc testAll()= - doAssert foo() == 1 - let c2=locals() - - testAll() |