Files
Nim/tests/assert/testhelper.nim
alaviss 2c10b246ec 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
2019-07-01 13:19:07 +02:00

13 lines
416 B
Nim

from strutils import endsWith, split
from os import isAbsolute
proc checkMsg*(msg, expectedEnd, name: string, absolute = true)=
let filePrefix = msg.split(' ', maxSplit = 1)[0]
if absolute and not filePrefix.isAbsolute:
echo name, ":not absolute: `", msg & "`"
elif not msg.endsWith expectedEnd:
echo name, ":expected suffix:\n`" & expectedEnd & "`\ngot:\n`" & msg & "`"
else:
echo name, ":ok"