Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwiftDocCUtilitiesTests: adjust TestFileSystem's handling of paths #655

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jul 7, 2023

When constructing a URL with a file path, we should always use init(fileURLWithPath:) as not all paths are represented as a URL and require additional encoding. On Windows, this would result in us stripping the drive prefix (C:) which would corrupt the path and thus fail to lookup the item. In the second instance, this allowed us to simply avoid an object copy entirely.

This helps improve the test pass rate significantly on Windows.

When constructing a `URL` with a file path, we should always use
`init(fileURLWithPath:)` as not all paths are represented as a URL and
require additional encoding.  On Windows, this would result in us
stripping the drive prefix (`C:`) which would corrupt the path and thus
fail to lookup the item.  In the second instance, this allowed us to
simply avoid an object copy entirely.

This helps improve the test pass rate significantly on Windows.
@compnerd
Copy link
Member Author

compnerd commented Jul 7, 2023

@swift-ci please test

@compnerd compnerd merged commit adc2200 into swiftlang:main Jul 7, 2023
@compnerd compnerd deleted the file-url branch July 7, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants