fixup #10466 to use runnableExamples (#10510)

This commit is contained in:
Timothee Cour 2019-01-30 22:19:16 -08:00 • committed by Miran
commit abcd9fd2e8

View file

@ -710,23 +710,20 @@ proc pretty*(node: JsonNode, indent = 2): string =
## on multiple lines. ## on multiple lines.
## ##
## Similar to prettyprint in Python. ## Similar to prettyprint in Python.
## runnableExamples:
## **Examples:** let j = %* {"name": "Isaac", "books": ["Robot Dreams"],
## "details": {"age":35, "pi":3.1415}}
## .. code-block:: Nim doAssert pretty(j) == """
## let j = %* {"name": "Isaac", "books": ["Robot Dreams"], {
## "details": {"age":35, "pi":3.1415}} "name": "Isaac",
## echo pretty(j) "books": [
## # { "Robot Dreams"
## # "name": "Isaac", ],
## # "books": [ "details": {
## # "Robot Dreams" "age": 35,
## # ], "pi": 3.1415
## # "details": { }
## # "age": 35, }"""
## # "pi": 3.1415
## # }
## # }
result = "" result = ""
toPretty(result, node, indent) toPretty(result, node, indent)