diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-04-30 02:00:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 11:00:33 +0200 |
commit | 20248a68fd867ce64822698b316f1a8b6300d7ca (patch) | |
tree | 73e601d34f14150a7a3cef76a24df185a36267c2 /nimdoc/rsttester.nim | |
parent | 16405083485967a395b8d677833bc26040881b21 (diff) | |
download | Nim-20248a68fd867ce64822698b316f1a8b6300d7ca.tar.gz |
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.
Diffstat (limited to 'nimdoc/rsttester.nim')
-rw-r--r-- | nimdoc/rsttester.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nimdoc/rsttester.nim b/nimdoc/rsttester.nim index 6d41ffb86..daca3dfc7 100644 --- a/nimdoc/rsttester.nim +++ b/nimdoc/rsttester.nim @@ -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) |