Add template tests for #3691.
This commit is contained in:
parent
4661ae22dd
commit
e01c3561dc
1 changed files with 5 additions and 4 deletions
|
|
@ -10,15 +10,16 @@ proc test[T]() =
|
||||||
echo(foobar.msg)
|
echo(foobar.msg)
|
||||||
doAssert(not declared(foobar))
|
doAssert(not declared(foobar))
|
||||||
|
|
||||||
template testTemplate() =
|
template testTemplate(excType: typedesc) =
|
||||||
try:
|
try:
|
||||||
raise newException(Exception, "Hello")
|
raise newException(excType, "Hello")
|
||||||
except Exception as foobar:
|
except excType as foobar:
|
||||||
echo(foobar.msg)
|
echo(foobar.msg)
|
||||||
doAssert(not declared(foobar))
|
doAssert(not declared(foobar))
|
||||||
|
|
||||||
proc test2() =
|
proc test2() =
|
||||||
testTemplate()
|
testTemplate(Exception)
|
||||||
doAssert(not declared(foobar))
|
doAssert(not declared(foobar))
|
||||||
|
|
||||||
test[Exception]()
|
test[Exception]()
|
||||||
|
test2()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue