Skip to content

Fix symLink's handling of / path separators on Windows #19136

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

Merged
merged 3 commits into from
Mar 2, 2024

Conversation

squeek502
Copy link
Collaborator

Follow up to #19126, fixes the Windows bug that was uncovered and re-enables the failing test.

@@ -494,6 +491,6 @@ test "tar pipeToFileSystem" {
try testing.expect((try root.dir.statFile("a/file")).kind == .file);
// TODO is there better way to test symlink
try testing.expect((try root.dir.statFile("b/symlink")).kind == .file); // statFile follows symlink
var buf: [8]u8 = undefined;
var buf: [32]u8 = undefined;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@rootbeer rootbeer left a comment

Choose a reason for hiding this comment

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

LGTM.

…ath separators

Now, all the tests that use `testWithAllSupportedPathTypes` will also run each test with both `/` and `\` as the path separator on Windows.

Also, removes the now-redundant "Dir.symLink with relative target that has a / path separator" since the same thing is now tested in the "Dir.readLink" test
@squeek502 squeek502 force-pushed the windows-symlink-path-sep branch from 8b049e5 to f1dd1ee Compare March 1, 2024 01:55
@rootbeer
Copy link
Contributor

rootbeer commented Mar 1, 2024

Nice update to the tester, that should cover a lot more cases.

@andrewrk andrewrk merged commit 64f77f3 into ziglang:master Mar 2, 2024
ianic added a commit to ianic/zig that referenced this pull request Mar 3, 2024
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After ziglang#19136 dir.symlink changes path separtors to \ on windows.
ianic added a commit to ianic/zig that referenced this pull request Mar 4, 2024
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After ziglang#19136 dir.symlink changes path separtors to \ on windows.
ianic added a commit to ianic/zig that referenced this pull request Mar 10, 2024
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After ziglang#19136 dir.symlink changes path separtors to \ on windows.
ianic added a commit to ianic/zig that referenced this pull request Mar 11, 2024
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After ziglang#19136 dir.symlink changes path separtors to \ on windows.
RossComputerGuy pushed a commit to ExpidusOS-archive/zig that referenced this pull request Mar 20, 2024
Fixing ci error: error:

'tar.test.test.pipeToFileSystem' failed: slices differ. first difference occurs at index 2 (0x2)

============ expected this output: =============  len: 9 (0x9)

2E 2E 2F 61 2F 66 69 6C  65                       ../a/file

============= instead found this: ==============  len: 9 (0x9)

2E 2E 5C 61 5C 66 69 6C  65                       ..\a\file

After ziglang#19136 dir.symlink changes path separtors to \ on windows.
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