[libcxx-commits] [libcxx] [libcxx][lit] Fixing libcxx test failures on Windows (PR #194752)

Vladimir Vereschaka via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 30 23:22:23 PDT 2026


vvereschaka wrote:

I took a look at the changes. Using `os.linesep` is not a good idea I think, because the line endings could be unix-style on Windows either. Probably removing of the line endings (both styles) before checking will be more optimal. Something like this:
```
self.assertEqual(f"{output2}".rstrip(), "MACRO=2")
```
instead of
```
self.assertEqual(output2, "MACRO=2%s" % os.linesep)
```
`rstrip()` removes all trailing whitespaces including \r \n. To keep the whitespace, it is possible to use `.replace("\n", "").replace("\r", "")` instead.

https://github.com/llvm/llvm-project/pull/194752


More information about the libcxx-commits mailing list