diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2017-02-06 19:25:09 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2017-02-06 19:25:09 +0100 |
commit | e01c3561dc6ed08cd6c34a29d12c4c9951840f4b (patch) | |
tree | f88486d2c0129bc3d01fc124d36808f6e97843f7 | |
parent | 4661ae22dd87727900eb7e106957afce2047e284 (diff) | |
download | Nim-e01c3561dc6ed08cd6c34a29d12c4c9951840f4b.tar.gz |
Add template tests for #3691.
-rw-r--r-- | tests/exception/texcas.nim | 9 |
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 |