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

Add support for <BLANKLINE> keyword #239

Open
skycaptain opened this issue Oct 2, 2019 · 5 comments
Open

Add support for <BLANKLINE> keyword #239

skycaptain opened this issue Oct 2, 2019 · 5 comments

Comments

@skycaptain
Copy link

Python doctest is using the keyword <BLANKLINE> for declaring empty lines within a doctest result. Using such a keyword helps the doctest parser finding connected blocks of tests.

See

@cbm755
Copy link
Collaborator

cbm755 commented Oct 2, 2019

This would only matter with -NORMALIZE_WHITESPACE---by default, we match any whitespace.

But I don't see any problem with some minimal support for these, e.g., replacing them with empty strings in want before comparing to got.

@skycaptain
Copy link
Author

Right, I thought of this to be a helper for the regex searching and seperating the doctests. In the end <BLANKLINE> gets replaced by a newline character.

@catch22
Copy link
Collaborator

catch22 commented Oct 2, 2019

I don't think we've needed this one so far (and we default to normalizing whitespace since there are differences between Octave and Matlab IIRC). Is this solving any problem that arises when using Sphinx?

@skycaptain
Copy link
Author

Right. Rethought this. Matlab prints out lots of blank lines, so legability would definitly suffer from such a keyword. But, without having looked at the code; when do you decide what line is still part of the doctest output and what part is of the helptext. Like in this test:
https://github.com/catch22/octave-doctest/blob/master/test/test_whitespace.m
Is it the two empty lines?

@catch22
Copy link
Collaborator

catch22 commented Oct 10, 2019

That's right ("When the m-file contains plaintext documentation, doctest finds tests by searching for lines that begin with >>. It then finds the expected output by searching for the next >> or two blank lines." in https://octave.sourceforge.io/doctest/function/doctest.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants