# Is it possible to interpolate a value in a doctest output?

**URL:** <https://discourse.julialang.org/t/is-it-possible-to-interpolate-a-value-in-a-doctest-output/102244>\
**Category:** General Usage\
**Tags:** documentation, documenter\
**Created:** [July 29, 2023, 3:58pm UTC](https://discourse.julialang.org/t/is-it-possible-to-interpolate-a-value-in-a-doctest-output/102244 "2023-07-29T15:58:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [July 29, 2023, 3:58pm UTC](https://discourse.julialang.org/t/is-it-possible-to-interpolate-a-value-in-a-doctest-output/102244/1 "2023-07-29T15:58:09Z")

</div>

Suppose I have a doctest for a package where I define `Chebyshev`:

````julia
```jldoctest
julia> Chebyshev(0..1)
Chebyshev(0..1)
```

````

Say, my package depends on another package that defines the interval `0..1`. Now, if the dependency decides to change how `0..1` is displayed to `0 .. 1`, this breaks my doctest for a seemingly trivial reason. Is it possible to interpolate the interval and rewrite the doctest as

````julia
```jldoctest
julia> Chebyshev(0..1)
Chebyshev($(0..1))
```

````

where the interval will not contribute to a breakage? It seems possible to add a regex filter, but that is easier to write for one-liners than for a block of code.
