JuliaDocs/Documenter.jl
GitHub で見るFeature request: jldoctest examples without testing against expected results
Open
#452 opened on 2017年3月20日
Type: Enhancementhelp wanted
説明
Hi!
I want to add examples to my functions, but in many cases it is hard or not necessary to test the expected output. However, it may still be useful to test whether the functions/examples runs through or crashes. Is it possible to have a jldoctest with such a behavior? Perhaps by omitting the line(s) with expected outcomes as shown below:
"""
func_with_untestable_output(invar)
```jldoctest
julia> func_with_untestable_output(invar)
# Nothing to test against
```
"""
function func_with_untestable_output(invar) ...
The behavior I am looking for is the equivalent to adding this piece of "code" to the markdown documents:
```@example
a = 1
b = 2
a + b
nothing # hide
```
However, I think it is more convenient to place the examples and testing whether they work or not directly in the files containing the Julia code, rather than in the markdown documents.