Closed compnerd closed 1 year ago
🙄 of course the failure would be related to line endings!
Here's one of the failures, but the other is similar:
D:\a\SWXMLHash\SWXMLHash\Tests\SWXMLHashTests\WhiteSpaceParsingTests.swift:55: error: WhiteSpaceParsingTests.testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace : XCTAssertEqual failed:
("Optional("\n \r\n this\r\n has\r\n white\r\n space\r\n \n ")") is not equal to
("Optional("\n \n this\n has\n white\n space\n \n ")")
That should be easy enough to add a platform check around them, though. I can add it to the PR later or you're welcome to if you get to it first.
Thanks for the contribution @compnerd! It looks great!
I think that the nicer way to handle this is via .gitattributes
to ensure that the files are checked out in unix line endings rather than native. That should give us the same behaviour on all the platforms.
Good call @compnerd and thanks again!
My pleasure! One favour to ask - would it be possible to get a tagged release with that by any chance?
Absolutely, I just published 7.0.2
out.
This set of patches enables building and passing the test suite on Windows. Primarily, treat Windows and Linux similarly. The platform specific behaviour here is the construction of the input paths where we now use
URL(fileURLWithPath:)
anddroppingLastPathComponent
andaddingPathComponent
to compute the location of the test input.