summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2017-02-06 19:25:09 +0100
committerDominik Picheta <dominikpicheta@gmail.com>2017-02-06 19:25:09 +0100
commite01c3561dc6ed08cd6c34a29d12c4c9951840f4b (patch)
treef88486d2c0129bc3d01fc124d36808f6e97843f7
parent4661ae22dd87727900eb7e106957afce2047e284 (diff)
downloadNim-e01c3561dc6ed08cd6c34a29d12c4c9951840f4b.tar.gz
Add template tests for #3691.
-rw-r--r--tests/exception/texcas.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/exception/texcas.nim b/tests/exception/texcas.nim
index dfbed8f46..627b36632 100644
--- a/tests/exception/texcas.nim
+++ b/tests/exception/texcas.nim
@@ -10,15 +10,16 @@ proc test[T]() =
     echo(foobar.msg)
   doAssert(not declared(foobar))
 
-template testTemplate() =
+template testTemplate(excType: typedesc) =
   try:
-    raise newException(Exception, "Hello")
-  except Exception as foobar:
+    raise newException(excType, "Hello")
+  except excType as foobar:
     echo(foobar.msg)
   doAssert(not declared(foobar))
 
 proc test2() =
-  testTemplate()
+  testTemplate(Exception)
   doAssert(not declared(foobar))
 
 test[Exception]()
+test2()
\ No newline at end of file