Convert julia-repl blocks to jldoctest format (#58594)
Convert appropriate julia-repl code blocks to jldoctest format to enable
automatic testing. In addition, this introduces a new `nodoctest =
"reason"`
pattern to annotate code blocks that are deliberate not doctested, so
future
readers will know not to try.
Many code blocks are converted, in particular:
- Manual pages: arrays.md, asynchronous-programming.md, functions.md,
integers-and-floating-point-numbers.md, metaprogramming.md,
multi-threading.md, performance-tips.md, variables.md,
variables-and-scoping.md
- Base documentation: abstractarray.jl, bitarray.jl, expr.jl, file.jl,
float.jl, iddict.jl, path.jl, scopedvalues.md, sort.md
- Standard library: Dates/conversions.jl, Random/RNGs.jl,
Sockets/addrinfo.jl
Key changes:
- Add filters for non-deterministic output (timing, paths, memory
addresses)
- Add setup/teardown for filesystem operations
- Fix parentmodule(M) usage in expr.jl for doctest compatibility
- Document double escaping requirement for regex filters in docstrings
- Update AGENTS.md with test running instructions
Note: Some julia-repl blocks were intentionally left unchanged when they
demonstrate language internals subject to change or contain
non-deterministic output that cannot be properly filtered.
Refs #56921
---------
Co-authored-by: Keno Fischer <Keno@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>