gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten (#17892)
* gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten * refactor with createTempDir * cleanup * refacotr * PRTEMP fake test spec changes to show effect of diffStrings * add runnableExamples for experimental/diff + cross-reference with gitutils * Revert "PRTEMP fake test spec changes to show effect of diffStrings" This reverts commit 57dc8d642dce6c1127c98b7cbc9edbfe747d4047.
This commit is contained in:
parent
1640508348
commit
20248a68fd
8 changed files with 99 additions and 52 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import os, strutils
|
||||
from std/private/gitutils import diffFiles
|
||||
|
||||
const
|
||||
baseDir = "nimdoc/rst2html"
|
||||
|
|
@ -19,7 +20,7 @@ proc testRst2Html(fixup = false) =
|
|||
exec("$1 rst2html $2" % [nimExe, sourceFile])
|
||||
let producedHtml = expectedHtml.replace('\\', '/').replace("/expected/", "/source/htmldocs/")
|
||||
if readFile(expectedHtml) != readFile(producedHtml):
|
||||
discard execShellCmd("diff -uNdr " & expectedHtml & " " & producedHtml)
|
||||
echo diffFiles(expectedHtml, producedHtml).output
|
||||
inc failures
|
||||
if fixup:
|
||||
copyFile(producedHtml, expectedHtml)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue