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

git CRLF config is breaking unit tests #81

Closed
jefflill opened this issue Oct 25, 2023 · 1 comment
Closed

git CRLF config is breaking unit tests #81

jefflill opened this issue Oct 25, 2023 · 1 comment
Assignees
Labels
bug Something isn't working test Related to testing

Comments

@jefflill
Copy link
Contributor

It looks like we have git configured for our repos to convert CRLF in source code to just LF. This is causing problems for unit tests that using verbatim string literals that assume that these strings will use CRLF for new lines. This is also discussed here:

https://stackoverflow.com/questions/48196840/c-sharp-verbatim-string-line-breaks-crlf-cr-or-lf

I've been also seeing build warnings saying that LFs will be converted into CRLFs for months now, which is probably related. I think @marcusbooyah must have changed the checkout policy a while ago.

We could reset this policy to CRLF locally but I don't want to go there right now. I'm going to modify the tests to ignore CR characters when present instead.

@jefflill jefflill self-assigned this Oct 25, 2023
@jefflill jefflill added bug Something isn't working test Related to testing labels Oct 25, 2023
@jefflill
Copy link
Contributor Author

jefflill commented Oct 25, 2023

I fixed these tests by using TestHelper.AssertEqualLines() instead of Assert.Equal()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Related to testing
Projects
None yet
Development

No branches or pull requests

1 participant