JuliaDocs/Documenter.jl

Feature request: jldoctest examples without testing against expected results

オープン

#452 opened on 2017/03/20

 (16 件のコメント) (5 件のリアクション) (0 人の担当者)Julia (513 件のフォーク)batch import
Type: Enhancementhelp wanted

Repository metrics

Stars
 (910 個のスター)
PR merge metrics
 (平均マージ 16d 9h) (30d で 3 merged PRs)

説明

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.

コントリビューターガイド