adopt tests

This commit is contained in:
Arne Döring
2018-11-08 18:40:15 +01:00
committed by Andreas Rumpf
parent 16353c2ac8
commit 77a0f3768b
3 changed files with 12 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ ttmpl(1)
ttmpl[int](1) #<- crash case #1
tproc[int]()
discard tproc[int]
let _ = tproc[int]
ttmpl[int]() #<- crash case #2
ttmpl[int] #<- crash case #3

View File

@@ -1,7 +1,7 @@
discard """
msg: '''"muhaha"
proc poo(x, y: int) =
let y = x
let y = x
echo ["poo"]'''
"""
@@ -16,14 +16,13 @@ proc poo(x, y: int) =
macro m(x: typed): untyped =
echo repr x.getImpl
result = x
discard m foo
discard m poo
m(foo)
m(poo)
#------------
macro checkOwner(x: typed, check_id: static[int]): untyped =
macro checkOwner(x: typed, check_id: static[int]): untyped =
let sym = case check_id:
of 0: x
of 1: x.getImpl.body[0][0][0]
@@ -32,11 +31,11 @@ macro checkOwner(x: typed, check_id: static[int]): untyped =
else: x
result = newStrLitNode($sym.owner.symKind)
macro isSameOwner(x, y: typed): untyped =
result =
macro isSameOwner(x, y: typed): untyped =
result =
if x.owner == y.owner: bindSym"true"
else: bindSym"false"
static:
doAssert checkOwner(foo, 0) == "nskModule"

View File

@@ -10,7 +10,7 @@ import times as bar3 except convert
import definitions as baz
discard foo.v
discard bar.now
discard bar2.now
discard bar3.now
discard baz.v
discard bar.now()
discard bar2.now()
discard bar3.now()
discard baz.v