diff options
author | Daniel Belmes <3631206+DanielBelmes@users.noreply.github.com> | 2023-08-05 11:50:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-06 02:50:47 +0800 |
commit | 7bf7496557d939331193069f56c3faa91d81d9d3 (patch) | |
tree | eb93a498f4f2e567154ea95afcc595a377872214 /nimdoc/rsttester.nim | |
parent | e0396900ed74eb821641d026a68415199fc4a257 (diff) | |
download | Nim-7bf7496557d939331193069f56c3faa91d81d9d3.tar.gz |
fix server caching issue causing Theme failures (#22378)
* fix server caching issue causing Theme failures * Fix tester to ignore version cache param * fix case of people using -d:nimTestsNimdocFixup * rsttester needed the same fix
Diffstat (limited to 'nimdoc/rsttester.nim')
-rw-r--r-- | nimdoc/rsttester.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nimdoc/rsttester.nim b/nimdoc/rsttester.nim index a0bdfca1e..be2b56c67 100644 --- a/nimdoc/rsttester.nim +++ b/nimdoc/rsttester.nim @@ -24,11 +24,13 @@ proc testRst2Html(fixup = false) = let sourceFile = expectedHtml.replace('\\', '/').replace("/expected/", "/source/").replace(".html", ".rst") exec("$1 rst2html $2" % [nimExe, sourceFile]) let producedHtml = expectedHtml.replace('\\', '/').replace("/expected/", "/source/htmldocs/") - if readFile(expectedHtml) != readFile(producedHtml): + let versionCacheParam = "?v=" & $NimMajor & "." & $NimMinor & "." & $NimPatch + let producedFile = readFile(producedHtml).replace(versionCacheParam,"") #remove version cache param used for cache invalidation + if readFile(expectedHtml) != producedFile: echo diffFiles(expectedHtml, producedHtml).output inc failures if fixup: - copyFile(producedHtml, expectedHtml) + writeFile(expectedHtml, producedFile) else: echo "SUCCESS: files identical: ", producedHtml if failures == 0: |