testhelper.nim 386 B

12345678910111213
  1. from strutils import endsWith, split
  2. from os import isAbsolute
  3. proc checkMsg*(msg, expectedEnd, name: string)=
  4. let filePrefix = msg.split(' ', maxSplit = 1)[0]
  5. if not filePrefix.isAbsolute:
  6. echo name, ":not absolute: `", msg & "`"
  7. elif not msg.endsWith expectedEnd:
  8. echo name, ":expected suffix:\n`" & expectedEnd & "`\ngot:\n`" & msg & "`"
  9. else:
  10. echo name, ":ok"