- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 26
 
Fixes to doctest processing #23
Conversation
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).
        
          
                juliadoc/jldoctest.py
              
                Outdated
          
        
      | 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')) | 
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 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.
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.
Good point. I could always throw a VERSION conditional in.
Additionally broke up the long `pushdisplay` line.
| # 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')) | 
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.
does this become unnecessary if dump gets fixed / changed back? or is it harmless to have anyway?
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.
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.
While updating the doctests for JuliaLang/julia#17106 I encountered several bugs with how doctests were being processed.