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

MockTextTerminal strips out new lines #35

Open
cdprete opened this issue Nov 19, 2021 · 0 comments
Open

MockTextTerminal strips out new lines #35

cdprete opened this issue Nov 19, 2021 · 0 comments

Comments

@cdprete
Copy link

cdprete commented Nov 19, 2021

On calling org.beryx.textio.mock.MockTextTerminal#getOutput the returned string has all the new lines and leading/trailing spaces removed because org.beryx.textio.mock.MockTextTerminal#stripAll is called on the stored string before returning it.

Given that the output is joined using the new line as separator, I assume this has been done in order to have a uniform and linear output.
Unfortunately, this doesn't allow to test certain scenarios, like "Does the output ends with a new line?".

In my opinion, stripping should be an option that the consumer of the class can decide to use or not.
A simple overload of getOutput() with a boolean flag would be enough :)

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

No branches or pull requests

1 participant