-
-
Notifications
You must be signed in to change notification settings - Fork 9
fix: return correct Parent
of DirectoryInfo
with trailing directory separator
#846
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the DirectoryInfo.Parent
property when the directory path contains a trailing directory separator. The issue was that the parent directory calculation incorrectly included the trailing separator, leading to wrong parent resolution.
Key Changes
- Fixed the
GetParent()
method inInMemoryLocation
to trim trailing directory separators before calculating the parent path - Added a comprehensive test case to verify the correct parent is returned when a directory path has a trailing separator
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
Source/Testably.Abstractions.Testing/Storage/InMemoryLocation.cs |
Modified GetParent() method to trim trailing directory separators before parent path calculation |
Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs |
Added test case and cleaned up existing test assertions to verify correct parent behavior with trailing separators |
Parent
of DirectoryInfo
with trailing directo…Parent
of DirectoryInfo
with trailing directory separator
Test Results 37 files ± 0 37 suites ±0 20m 59s ⏱️ ±0s Results for commit 48f566a. ± Comparison against base commit 78b0421. This pull request removes 35757 and adds 35788 tests. Note that renamed tests count towards both.
This pull request removes 1784 skipped tests and adds 1784 skipped tests. Note that renamed tests count towards both.
|
|
This is addressed in release v4.3.3. |
This PR fixes a bug in the
DirectoryInfo.Parent
property when the directory path contains a trailing directory separator. The issue was that the parent directory calculation incorrectly included the trailing separator, leading to wrong parent resolution.Key Changes
GetParent()
method inInMemoryLocation
to trim trailing directory separators before calculating the parent path