summary refs log tree commit diff stats
path: root/tests/misc/trunner.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-08-21 08:09:48 +0800
committerGitHub <noreply@github.com>2022-08-20 20:09:48 -0400
commitd8d86e07c39be1d41f2d26eabc8cbdf87b799d8e (patch)
tree14f6563071198b6a84429ec7668e1e926fccf7ef /tests/misc/trunner.nim
parent1b61e71bb81ba53cf3cfbcbb581fa61cf7fac612 (diff)
downloadNim-d8d86e07c39be1d41f2d26eabc8cbdf87b799d8e.tar.gz
fixes #11953; jsondoc creates no files unless the htmldocs dir is created (#20198)
* fixes #11953; jsondoc creates no files unless the htmldocs dir is created

* target

* fixes runner
Diffstat (limited to 'tests/misc/trunner.nim')
-rw-r--r--tests/misc/trunner.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim
index 541e3a390..add92cbfd 100644
--- a/tests/misc/trunner.nim
+++ b/tests/misc/trunner.nim
@@ -232,6 +232,22 @@ sub/mmain.idx""", context
     doAssert doSomething["col"].getInt == 0
     doAssert doSomething["code"].getStr == "proc doSomething(x, y: int): int {.raises: [], tags: [], forbids: [].}"
 
+  block: # nim jsondoc # bug #11953
+    let file = testsDir / "misc/mjsondoc.nim"
+    let destDir = testsDir / "misc/htmldocs"
+    removeDir(destDir)
+    defer: removeDir(destDir)
+    let (msg, exitCode) = execCmdEx(fmt"{nim} jsondoc {file}")
+    doAssert exitCode == 0, msg
+
+    let data = parseJson(readFile(destDir / "mjsondoc.json"))["entries"]
+    doAssert data.len == 4
+    let doSomething = data[0]
+    doAssert doSomething["name"].getStr == "doSomething"
+    doAssert doSomething["type"].getStr == "skProc"
+    doAssert doSomething["line"].getInt == 1
+    doAssert doSomething["col"].getInt == 0
+    doAssert doSomething["code"].getStr == "proc doSomething(x, y: int): int {.raises: [], tags: [], forbids: [].}"
 
   block: # further issues with `--backend`
     let file = testsDir / "misc/mbackend.nim"