Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Fixes to doctest processing #23

Merged
merged 4 commits into from
Jun 25, 2016
Merged

Fixes to doctest processing #23

merged 4 commits into from
Jun 25, 2016

Conversation

omus
Copy link
Member

@omus omus commented Jun 25, 2016

While updating the doctests for JuliaLang/julia#17106 I encountered several bugs with how doctests were being processed.

omus added 3 commits June 23, 2016 21:16
The `dump` call was not providing a trailing newline which was causing
the doctests to hang since the seperator never appeared on its own line.
Code has been changed such that the seperator will always appear after
a newline.
Issue was due to `self._checker.output_difference` and
`self._failure_header` sometimes returning different types
(unicode and string).
@@ -808,6 +808,7 @@ def test_group(self, group, filename):
j = Popen(["../julia"], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
j.stdin.write("macro raw_str(s) s end;nothing\n".encode('utf-8'))
j.stdin.write("_ans = nothing\n".encode('utf-8'))
j.stdin.write("pushdisplay(TextDisplay(IOContext(IOContext(STDOUT, :multiline => true), :limit => true))); nothing\n".encode('utf-8'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this now becomes 0.5-only. So if any bugfixes are ever needed to JuliaDoc for 0.4 we can go back and branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I could always throw a VERSION conditional in.

Additionally broke up the long `pushdisplay` line.
@@ -480,14 +480,14 @@ def __run(self, test, out):
self.julia.stdin.write('_ans=ans; nothing\n'.encode('utf-8'))
# read separator
sep = 'fjsdiij3oi123j42'
self.julia.stdin.write(('println("' + sep + '")\n').encode('utf-8'))
self.julia.stdin.write(('println("\\n' + sep + '")\n').encode('utf-8'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this become unnecessary if dump gets fixed / changed back? or is it harmless to have anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we don't need this fix if dump gets fixed. I definitely still want to include this fix as it seems unreasonable for doctests to hang forever just because the output of a call doesn't have a trailing newline.

@tkelman tkelman merged commit 8dbccf7 into JuliaLang:master Jun 25, 2016
@omus omus deleted the doctest-fix branch June 25, 2016 15:29
omus added a commit to omus/julia that referenced this pull request Jun 29, 2016
omus added a commit to omus/julia that referenced this pull request Jul 7, 2016
omus added a commit to omus/julia that referenced this pull request Jul 8, 2016
omus added a commit to omus/julia that referenced this pull request Jul 11, 2016
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants