diff options
author | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-05-26 19:32:50 -0400 |
---|---|---|
committer | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-06-07 13:12:18 -0400 |
commit | 90ed34db72e8ea8f70d1e86dd2335efe48532fa8 (patch) | |
tree | 9d9e46c0ddbb87f562981f072220bd36a7f199cb /lib/pure/unittest.nim | |
parent | 075a5e844069979f1fc3782839e9e2cc62c61ad5 (diff) | |
parent | bbb1bdb4a939aa43ed981acc2f96bce918be7d21 (diff) | |
download | Nim-90ed34db72e8ea8f70d1e86dd2335efe48532fa8.tar.gz |
Merge branch 'devel' of https://github.com/Araq/Nim into add-nre
* 'devel' of https://github.com/Araq/Nim: Fix #964, fix #1384 Don't inspect typedescs
Diffstat (limited to 'lib/pure/unittest.nim')
-rw-r--r-- | lib/pure/unittest.nim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 3bf4724b9..dbbd3cabc 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -99,8 +99,9 @@ template test*(name: expr, body: stmt): stmt {.immediate, dirty.} = body except: - checkpoint("Unhandled exception: " & getCurrentExceptionMsg()) - echo getCurrentException().getStackTrace() + when not defined(js): + checkpoint("Unhandled exception: " & getCurrentExceptionMsg()) + echo getCurrentException().getStackTrace() fail() finally: @@ -114,9 +115,7 @@ proc checkpoint*(msg: string) = template fail* = bind checkpoints for msg in items(checkpoints): - # this used to be 'echo' which now breaks due to a bug. XXX will revisit - # this issue later. - stdout.writeln msg + echo msg when not defined(ECMAScript): if abortOnError: quit(1) @@ -157,12 +156,13 @@ macro check*(conditions: stmt): stmt {.immediate.} = # Ident !"v" # IntLit 2 paramAst = exp[i][1] - argsAsgns.add getAst(asgn(arg, paramAst)) - argsPrintOuts.add getAst(print(argStr, arg)) - if exp[i].kind != nnkExprEqExpr: - exp[i] = arg - else: - exp[i][1] = arg + if exp[i].typekind notin {ntyTypeDesc}: + argsAsgns.add getAst(asgn(arg, paramAst)) + argsPrintOuts.add getAst(print(argStr, arg)) + if exp[i].kind != nnkExprEqExpr: + exp[i] = arg + else: + exp[i][1] = arg case checked.kind of nnkCallKinds: |