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

disable broken test case on Windows #101

Open
wants to merge 2 commits into
base: release/1.3.0
Choose a base branch
from

Conversation

compnerd
Copy link
Collaborator

This test triggers an assertion failure. It is unclear why this is
currently being parsed improperly.

This test triggers an assertion failure.  It is unclear why this is
currently being parsed improperly.
@compnerd compnerd marked this pull request as draft June 12, 2022 18:40
#if !os(Windows)
testPaths += [
TestPathComponents("//foo///bar/baz/", root: "/", ["foo", "bar", "baz"]),
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows, would it become something like root: #"\\foo\\"#, ["bar", "baz"]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I need to check, but that is what I would expect. However, I don't remember if this was a case where we were asserting incorrectly or not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we fix up incomplete roots and make them complete. C# seems to be pretty inconsistent / emergent-behaviorish here, but that's the only sensible model I could think of at the time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the model is correct in that the behaviour is what we would like. The question is more about whether the behaviour matches the implementation or not (aka, there is a bug - I think that we were asserting on an empty path component somewhere?). Sorry if it came across as I didn't think that the behaviour was correct.

Copy link
Contributor

@milseman milseman Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path components cannot be empty, but I wonder if we should allow empty server or share portions of a UNC path root. Sorry, I've paged a lot of this out and am just getting back up to speed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> [IO.Path]::GetFullPath("//foo///bar/baz/")
\\foo\bar\baz\
> [IO.Path]::GetPathRoot("//foo///bar/baz/")
\\foo\bar
> [IO.Path]::GetPathRoot([IO.Path]::GetFullPath("//foo///bar/baz/"))
\\foo\bar

This also matches the Microsoft documentation on path normalization:

Normally, any path passed to a Windows API is (effectively) passed to the GetFullPathName function and normalized. There is one important exception: a device path that begins with a question mark instead of a period. Unless the path starts exactly with \?\ (note the use of the canonical backslash), it is normalized.

@compnerd
Copy link
Collaborator Author

@tomerd wanted to make progress on adopting System for SPM, and we need to resolve this (along with the other test failures). I've since paged a lot of the path processing out, but I think that this particular case should be parsed as \\foo\bar, baz (I will verify that).

@glessard
Copy link
Contributor

@swift-ci please test

@glessard
Copy link
Contributor

I would like to unblock the rest of Windows testing, so I am inclined to merge this with the addition of a link to issue 137.

@glessard
Copy link
Contributor

@swift-ci please test

@glessard glessard changed the base branch from main to release/1.3.0 March 20, 2024 01:31
@glessard glessard marked this pull request as ready for review March 20, 2024 01:40
@glessard glessard changed the title DNM: Tests: disable test on Windows disable broken test case on Windows Mar 20, 2024
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.

3 participants