summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/exception/texcas.nim17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/exception/texcas.nim b/tests/exception/texcas.nim
index 807f2c802..a00b09a8f 100644
--- a/tests/exception/texcas.nim
+++ b/tests/exception/texcas.nim
@@ -1,10 +1,25 @@
 discard """
-  output: '''Hello'''
+  output: '''Hello
+  Hello
+  '''
 """
 proc test[T]() =
   try:
     raise newException(T, "Hello")
   except T as foobar:
     echo(foobar.msg)
+  echo(declared(foobar))
+  doAssert(not declared(foobar))
+
+template testTemplate() =
+  try:
+    raise newException(Exception, "Hello")
+  except Exception as foobar:
+    echo(foobar.msg)
+  doAssert(not declared(foobar))
+
+proc test2() =
+  testTemplate()
+  doAssert(not declared(foobar))
 
 test[Exception]()