Open McMaartenz opened 2 years ago
The following assertion should work on a Windows file format: test/test.c:78 --
assert(strstr(str, "; TEST\n") == str);
The assertion fails because \n != \r\n on Windows file formats, which include a carriage return.
\n != \r\n
Add check for carriage return using the 'or' operator, such as:
assert(strstr(str, "; TEST\n") == str || strstr(str, "; TEST\r\n") == str);
$ ./bin/test
Host OS: Windows 10 Pro x86_64 21H2 19044.1706 Guest OS: WSL2 Ubuntu 20.04 x86_64 Guest kernel: 5.10.16.3-microsoft-standard-WSL2
Expected behaviour
The following assertion should work on a Windows file format: test/test.c:78 --
Current behaviour
The assertion fails because
\n != \r\n
on Windows file formats, which include a carriage return.Possible solution
Add check for carriage return using the 'or' operator, such as:
Steps to reproduce
$ ./bin/test
Host OS: Windows 10 Pro x86_64 21H2 19044.1706 Guest OS: WSL2 Ubuntu 20.04 x86_64 Guest kernel: 5.10.16.3-microsoft-standard-WSL2