When fixing doctests with errors, don't overwrite [...]
#2642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes it is useful to show errors in doctests. However if those contain stacktraces, this can be problematic as those contain line numbers which will change over time (and often also when e.g. Julia or some dependencies change). And sometimes it is simply desirable to shorten the error message for other reasons.
For this reason Documenter supports replacing part of the error message with
[...]
which can be used to omit e.g. a stacktrace while still passing doctest checks.However so far using Documenter's
doctest=:fix
feature would replace all uses of[...]
by the full error message, making it unnecessarily tedious to update doctests in packages that use this feature.This patch changes that by skipping doctest fixups for tests where the reference output ends with
[...]
and otherwise matches the actual error message as a prefix.Resolves #2511
CC @thofma