Files
Nim/tests/assert/testhelper.nim
2018-11-19 09:22:21 +01:00

13 lines
386 B
Nim

from strutils import endsWith, split
from os 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"