JuliaDocs / Documenter.jl

A documentation generator for Julia.

Home Page:https://documenter.juliadocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doctest fix versus exceptions

fingolfin opened this issue · comments

Consider a doctest looking like this, testing a thrown exception with omitted stacktrace:

```jldoctest
julia> error("x")
ERROR: x
```

It is very nice that Documenter allows me to write that, so the paths and line numbers from the stack trace are omitted.

Alas, it seems that code for fixing outdated doctests is not quite aware of this. Running that turns the above back into

```jldoctest
julia> error("x")
ERROR: x
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] top-level scope
   @ REPL[2]:1
```

One then has to carefully edit those out again, preserving any "real" fixes.

Would it be possible to teach fix about the exception made for exceptions, so it preserves the output if it "matched" according to the exceptions rule?