Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/+windows-symlink-samefile.infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compare the symlinked-root scan test path by filesystem identity so it passes on Windows.
8 changes: 5 additions & 3 deletions test/unit/scan/test_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def test_make_full_path_accepts_internal_link_and_symlinked_root(tmp_path):

result = LocalFolder(root_link).make_full_path('link/new-file.txt')
expected = str(root_link / 'link' / 'new-file.txt')
# On Windows, symlink resolution can return an extended-length ("\\?\\") path,
# so compare the resolved real paths rather than the raw strings.
assert os.path.realpath(result) == os.path.realpath(expected)
# Windows symlink resolution can add an extended-length ("\\?\\") prefix that
# realpath does not normalize away, so compare by filesystem identity of the
# (existing) parent directory plus the file name instead of raw strings.
assert os.path.basename(result) == os.path.basename(expected) == 'new-file.txt'
assert os.path.samefile(os.path.dirname(result), os.path.dirname(expected))
Loading