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

Tests_Import_Parser::test_blank_lines_in_content(): minor test fix #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 13, 2024

Depending on how a git repo is cloned, files may have *nix line endings or Windows line endings. Now, as this test uses a file based fixture, this has an impact on the tests.

As things are, the test basically assumes that core.autocrlf=true (change line endings based on the OS) is used, while that is an assumption which cannot be made.

This can lead to confusion for contributors when they are confronted by an inexplicably failing test.

As the Windows line ending \r\n includes the *nix line ending \n anyway, changing the test to just check for the count of the \n characters maintains the value of the test, while preventing test failures for contributors who run the test on Windows and check out with core.autocrlf=input.

Depending on how a git repo is cloned, files may have *nix line endings or Windows line endings.
Now, as this test uses a file based fixture, this has an impact on the tests.

As things are, the test basically assumes that `core.autocrlf=true` (change line endings based on the OS) is used, while that is an assumption which cannot be made.

This can lead to confusion for contributors when they are confronted by an inexplicably failing test.

As the Windows line ending `\r\n` includes the *nix line ending `\n` anyway, changing the test to just check for the count of the `\n` characters maintains the value of the test, while preventing test failures for contributors who run the test on Windows and check out with `core.autocrlf=input`.
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

Successfully merging this pull request may close these issues.

1 participant