Skip to content

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.

@github-actions
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
@sonarqubecloud
Copy link

@vbreuss vbreuss enabled auto-merge (squash) August 12, 2024 09:41
@vbreuss vbreuss merged commit 5e768d1 into main Aug 12, 2024
@vbreuss vbreuss deleted the topic/test-caseonly-change-for-copy-move-and-replace branch August 12, 2024 09:52
@github-actions
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.

2 participants