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

fix: Throw correct exception when using File.Replace with case-only changes on MacOS #638

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

vbreuss
Copy link
Member

@vbreuss vbreuss commented Aug 11, 2024

When calling File.Replace with source and destination only differing in casing, on MacOS the file system throws an exception that "Source and destination path must be different". Consider this case also in the MockFileSystem.

Also add tests for correct handling of case-only changes in File.Move and File.Copy.

Note: This fix was inspired by TestableIO/System.IO.Abstractions#1140 and TestableIO/System.IO.Abstractions#1138.

Copy link

Stryker.NET mutation tested the changes in the pull request:
Mutation testing badge

@vbreuss vbreuss changed the title test: Add tests for case-only changes in File.Copy, File.Move and File.Replace fix: Throw correct exception when using File.Replace with case-only changes on MacOS Aug 12, 2024
@vbreuss vbreuss marked this pull request as ready for review August 12, 2024 09:28
Copy link

sonarcloud bot commented Aug 12, 2024

@vbreuss vbreuss enabled auto-merge (squash) August 12, 2024 09:41
@vbreuss vbreuss merged commit 5e768d1 into main Aug 12, 2024
13 checks passed
@vbreuss vbreuss deleted the topic/test-caseonly-change-for-copy-move-and-replace branch August 12, 2024 09:52
Copy link

This is addressed in release v3.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant