Skip to content

Commit f9a5148

Browse files
committed
Tests: explicitly convert to UTF16 on Windows
File paths on Windows are represented in UTF16, while Swift strings are UTF8. Explicitly convert from UTF16 on Windows.
1 parent 025bcb1 commit f9a5148

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/SystemTests/FilePathTests/FilePathTest.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ final class FilePathTest: XCTestCase {
6969
}
7070

7171
testPath.filePath.withPlatformString {
72+
#if os(Windows)
73+
XCTAssertEqual(testPath.string, String(decodingCString: $0, as: UTF16.self))
74+
#else
7275
XCTAssertEqual(testPath.string, String(cString: $0))
76+
#endif
7377
XCTAssertEqual(testPath.filePath, FilePath(platformString: $0))
7478
}
7579
}

0 commit comments

Comments
 (0)