diff options
author | alaviss <alaviss@users.noreply.github.com> | 2019-07-01 11:19:07 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-07-01 13:19:07 +0200 |
commit | 2c10b246ec8319a9f065d5ef50fc891eeffc7ad9 (patch) | |
tree | b941e8c95bdf86d12c54a20cd80156235ff500c3 /lib/system | |
parent | bd55c862a6ed8ee33caab2e93e1ad7f9e5bd85a5 (diff) | |
download | Nim-2c10b246ec8319a9f065d5ef50fc891eeffc7ad9.tar.gz |
assertions: fixes #11545 (#11605)
* assertions: properly fix #11545 * tests/assert: enable excessiveStackTrace * tests/assert: add test case for #11545 * tfailedassert_stacktrace: disable excessiveStackTrace * assertions: weird workaround for failing tests This fixes megatest on *nix, but have no idea why
Diffstat (limited to 'lib/system')
-rw-r--r-- | lib/system/assertions.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/system/assertions.nim b/lib/system/assertions.nim index 67f94aa1f..0a1ec5950 100644 --- a/lib/system/assertions.nim +++ b/lib/system/assertions.nim @@ -27,13 +27,15 @@ proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} = Hide(raiseAssert)(msg) template assertImpl(cond: bool, msg: string, expr: string, enabled: static[bool]) = - const loc = $instantiationInfo(-1, true) + const + loc = instantiationInfo(fullPaths = compileOption("excessiveStackTrace")) + ploc = $loc bind instantiationInfo mixin failedAssertImpl when enabled: - {.line: instantiationInfo(fullPaths = compileOption("excessiveStackTrace")).}: + {.line: loc.}: if not cond: - failedAssertImpl(loc & " `" & expr & "` " & msg) + failedAssertImpl(ploc & " `" & expr & "` " & msg) template assert*(cond: untyped, msg = "") = ## Raises ``AssertionError`` with `msg` if `cond` is false. Note |