doAssert, assert now print full path of failing line on error (#8555)
This commit is contained in:
parent
81f920a4ee
commit
3a626179ee
6 changed files with 109 additions and 32 deletions
12
tests/assert/testhelper.nim
Normal file
12
tests/assert/testhelper.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from strutils import endsWith, split
|
||||
from ospaths import isAbsolute
|
||||
|
||||
proc checkMsg*(msg, expectedEnd, name: string)=
|
||||
let filePrefix = msg.split(' ', maxSplit = 1)[0]
|
||||
if 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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue