-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a prefix when replacing for doctest=:fix #2378
Conversation
fff94ea
to
d16a138
Compare
Sorry for the delay here. I can confirm that the bug is there, but it doesn't look like the PR fixes it right now. I'm getting this after fixing:
Which is slightly different than the original bug, but still wrong. cc @fredrikekre: if you have any bandwith to help with this? |
This should work now. The testcases I added never had the output suppressed with |
There are some other cleaner approaches but these would require a larger refactoring, so I just went for a minimal approach. |
@benlorenz pointed out to me, that the tests are failing now because Julia has changed the output format for errors. Here is the difference:
Now current Julia:
i.e. the backticks were added. I added a commit to account for this in the tests by having a separate file for 1.6. |
…chture in github actions tests
f1d185b
to
f264eaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me (I made two trivial and optional change suggestions to match the style of the surrounding code).
It would be a pity if this fix for a real-world problem would be wasted :-(
Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @lkastner! Apologies that it took a while to get this reviewd -- this is a great PR! We'll have it in 1.4.0, and I think we can tag that this week.
I took the liberty of adding a CHANGELOG and also editing the code a bit, to simplify it a bit and make it a bit more Julia (in my opinion).
It looks like there's still a regression, or some issue, here. This doctest
does not fix itself on nightly (and causes the test failures). But it (more or less) works with the latest Documenter. I say more or less, since it will get replaced with
so the first doctest is not being fixed for some reason. |
Previously it was enough to check for substring also in the doctest=:fix mode, but this does not work with more complicated error messages
Could someone with the relevant permissions (e.g. @mortenpi) please allow the CI tests to run? |
I managed to fix the tests on nightly. The main reason for failure was that the error messages in nightly have an
added. I modified the error messages in the tests and have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to merge this. Thank you very much for sticking with this, and sorry it took so long to get this done and merged!
Attempt fixing #2303
The logic is as follows: The repl session is split into two parts, the first part goes from the start until the current command, and the second part is the rest. The old output is removed from the second part and replaced by the correct output. However if the command e.g. was just
a
for displaying the variablea
, then the split could incorrectly happen at thea
injulia>
. The new logic introduces a prefix containing the entire repl until the current command, so the split happens after (prefix + command) is found.