fix: add existence check for cli test

This commit is contained in:
Daylin Morgan 2023-09-17 11:12:17 -05:00
parent 3db462973b
commit e77ad85cd3
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -19,7 +19,7 @@ suite "cli":
cli = pathToSrc / "bbansi.out" cli = pathToSrc / "bbansi.out"
srcDir = pathToSrc / ".." / "src" srcDir = pathToSrc / ".." / "src"
cmd = "nim c -o:" & cli & " " & (srcDir / "bbansi.nim") cmd = "nim c -o:" & cli & " " & (srcDir / "bbansi.nim")
if getFileInfo(cli).lastWriteTime < getFileInfo(srcDir).lastWriteTime: if not cli.fileExists or getFileInfo(cli).lastWriteTime < getFileInfo(srcDir).lastWriteTime:
check execCmdEx(cmd).exitCode == 0 check execCmdEx(cmd).exitCode == 0
test "simple": test "simple":
check "\e[31mRed\e[0m" == cliRun "[red]Red[/]" check "\e[31mRed\e[0m" == cliRun "[red]Red[/]"