Unit test fails due to carriage return

I have a problem dealing with circle ci running test when deploying. I have unit test that has a formatted message. I use this message in an assert as the expected. in my hard coded test it has \r in the it. When the tests are run in Visual Studio they all work. When the tests are run thru circleci the actual result does not match the hard coded variable, it is missing the \r in the string built by string builder.

Can anyone help with this issue?

I bet this is falling foul of the different line endings in Windows vs Linux. In your test, you could do a search for \r\n and swap them for \n, and then do the assertion. I expect you have a text file, config file or code file somewhere written in Windows which traps the double-control-char format.

Yes you are correct. thanks I will try that.

1 Like