Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

Allow replacements in doctest filters

Open mortenpi opened this issue 4 years ago • 0 comments

This allows regex - substitution pairs to be passed as doctest filters, giving more control over filtering.

For example, the following filter can be used to only retain the first 8 digits after the decimal point of a floating point number: r"([0-9]+\.[0-9]{8})[0-9]+" => s"\1***"

This means that this will pass (sqrt(2) == 1.4142135623730951):

```jldoctest; filter = r"([0-9]+\.[0-9]{8})[0-9]+" => s"\1***"
julia> sqrt(2)
1.41421356000
```

But this will not:

```jldoctest; filter = r"([0-9]+\.[0-9]{8})[0-9]+" => s"\1***"
julia> sqrt(2)
1.4142999999999
```

mortenpi avatar Mar 24 '20 04:03 mortenpi