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

Unit tests fail if terminal window is not exactly 80 characters wide #593

Closed
rmunn opened this issue Mar 12, 2020 · 4 comments
Closed

Unit tests fail if terminal window is not exactly 80 characters wide #593

rmunn opened this issue Mar 12, 2020 · 4 comments

Comments

@rmunn
Copy link
Contributor

rmunn commented Mar 12, 2020

#589 adds a check for sut.Settings.MaximumDisplayWidth.Should().Be(80), but that will fail if you run dotnet test in a Linux terminal window that's a different size.

To Reproduce:

  1. Clone the repo
  2. Open a Linux terminal window and don't resize it, so it's 80x24 (the usual default)
  3. Run dotnet test. It works.
  4. Resize the terminal window so it's one character wider
  5. Run dotnet test. It fails with "Expected sut.Settings.MaximumDisplayWidth to be 80, but found 81."

Note that on my dev laptop, I habitually run terminal windows at maximum screen width, so for me the exception was "Expected sut.Settings.MaximumDisplayWidth to be 80, but found 272."

Solution:

Don't assume any particular value for MaximumDisplayWidth; just check that it's greater than 1.

@rmunn
Copy link
Contributor Author

rmunn commented Mar 12, 2020

The problem line is this one, BTW.

@moh-hassan
Copy link
Collaborator

Thanks @rmunn
I fixed the issue with a PR .

moh-hassan added a commit that referenced this issue Mar 12, 2020
@moh-hassan
Copy link
Collaborator

Linux is added as other CI and all tests passed in Ubuntu 18.04

@rmunn
Copy link
Contributor Author

rmunn commented Mar 13, 2020

I can verify that #597 fixes this issue on my development laptop.

@rmunn rmunn closed this as completed Mar 13, 2020
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

2 participants