I have a file that has been created on Windows, so it has carriage returns “\r\n”.
The file is used in a test, the contents of the file are compared to the contents of a file that is generated during the test. The test passes on Windows because the generated file has the same carriage return.
But the test doesn’t pass on Unix/Mac.
It fails because the generated file has linefeeds, ie. only “\n”.
Can any one advise how to deal with this?
Edit:
The test is a JUnit (Java) test.
I ended up not using a real file, and had the test create the file on the platform at runtime using the system property to get the platforms line terminator.