summary refs log blame commit diff stats
path: root/tests/assert/testhelper.nim
blob: 03bdd2468337a1e01ec612a3c505d34b16d72657 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                    
                         
 
                                                                
                                                  
                                            





                                                                              
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"