Skip to content
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

correct all doctests to account for new whitespace printing #20417

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Feb 2, 2017

This is an automated update of all doctests to make them passing (esp. following the RIP caused by #20288).

If there's other outstanding work-in-progess (or just a general need to update them again), the following patch seems to get 99+% accuracy: After applying this do doc/deps/v0.6/Documenter.jl, run it with:

cd doc && ../julia --color=no make.jl -- doctest
diff --git a/src/DocChecks.jl b/src/DocChecks.jl
index 8772122..c79ec90 100644
--- a/src/DocChecks.jl
+++ b/src/DocChecks.jl
@@ -319,6 +319,16 @@ end
 import .Utilities.TextDiff
 
 function report(result::Result, str, doc::Documents.Document)
+    if true
+        open(Base.find_source_file(result.file), "r+") do f
+            content = readstring(f)
+            seekstart(f)
+            truncate(f, 0)
+            content = replace(content, result.output, str)
+            write(f, content)
+        end
+        return
+    end
     local buffer = IOBuffer()
     println(buffer, "=====[Test Error]", "="^30)
     println(buffer)

@fredrikekre
Copy link
Member

You are a hero. 💯

@ararslan ararslan added docsystem The documentation building system test This change adds or pertains to unit tests labels Feb 2, 2017
@ararslan ararslan changed the title correct all doctests to account for new whitespce printing correct all doctests to account for new whitespace printing Feb 2, 2017
@pkofod pkofod mentioned this pull request Feb 3, 2017
38 tasks
@KristofferC
Copy link
Sponsor Member

KristofferC commented Feb 3, 2017

Thanks a lot for this. So should we try to get the current doctests merged first and then rerun this or merge this and rebase the doctests?

@KristofferC KristofferC merged commit 1d2a66f into master Feb 3, 2017
@KristofferC
Copy link
Sponsor Member

I'm gonna go ahead and merge this now (a bit quicker than normally) so that work can continue on doctests. Updating should be easy just be running @vtjnash script.

@KristofferC KristofferC deleted the jn/doctest-fixup branch February 3, 2017 15:23
mortenpi added a commit to JuliaDocs/Documenter.jl that referenced this pull request Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants