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

Ignore empty space at the begin of the got string even if the expected does not use <...> #275

Open
eldipa opened this issue Nov 15, 2022 · 0 comments
Labels
enhancement something nice to have but it is not neither critical nor urgent
Milestone

Comments

@eldipa
Copy link
Collaborator

eldipa commented Nov 15, 2022

Describe the feature you'd like
It is not uncommon to have a code that outputs one or more empty lines at the begin of stream before writing anything else.

Because byexample requires non-empty lines in the expected string, the user must or use <...> or +rm=~ plus possibly +norm-ws.

This obviously is annoying.

The proposal is to ignore any empty line (with or without spaces) at the begin of the got.

Additional context (optional)
Considerations:

>>> print("\n  \nSome line") # should work as it is correct
<...>
Some line

>>> print("\n  \nSome line") # should work as it is correct
<...>Some line

>>> print("\n  \nSome line") # should work too (empty lines skipped) 
Some line
>>> print("\n  \n  Some line") # should fail (missing indentation)
<...>
Some line

>>> print("\n  \n  Some line") # should work as it is correct
<...>Some line

>>> print("\n  \n  Some line") # should fail (missing indentation) 
Some line
>>> print("\n  \n  Some line") # +norm-ws should work
<...>
Some line

>>> print("\n  \n  Some line") # +norm-ws should work
<...>Some line

>>> print("\n  \n  Some line")  # +norm-ws should work 
Some line
@eldipa eldipa added the enhancement something nice to have but it is not neither critical nor urgent label Nov 15, 2022
@eldipa eldipa added this to the 11.0.0 milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement something nice to have but it is not neither critical nor urgent
Projects
None yet
Development

No branches or pull requests

1 participant