-
-
Notifications
You must be signed in to change notification settings - Fork 9
fix: enumerate directories with trailing slash #803
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: enumerate directories with trailing slash #803
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 issue #802 by ensuring that directories with trailing slashes are properly enumerated. The fix addresses a bug where GetFileName was not handling directory paths with trailing separators correctly.
- Adds logic to trim trailing directory separators before calling
GetFileNamein enumeration - Includes a test case to verify empty directories with trailing slashes are properly enumerated
- Contains an unrelated formatting change to lambda expression formatting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| EnumerateDirectoriesTests.cs | Adds test case to verify directories with trailing slashes are enumerated correctly |
| InMemoryStorage.cs | Fixes enumeration logic to handle trailing directory separators and includes minor formatting change |
Comments suppressed due to low confidence (1)
Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs:255
- [nitpick] The variable name 'itemPath' is somewhat redundant since it's derived from 'item.Key.FullPath'. Consider a more descriptive name like 'normalizedPath' or 'pathWithoutTrailingSlash' to better reflect its purpose after the trimming operation.
string? itemPath = item.Key.FullPath;
Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs
Outdated
Show resolved
Hide resolved
…teDirectoriesTests.cs Co-authored-by: Copilot <[email protected]>
|
Test Results 37 files ± 0 37 suites ±0 15m 47s ⏱️ -2s Results for commit 0e55b41. ± Comparison against base commit d3f8cdb. This pull request removes 35206 and adds 35213 tests. Note that renamed tests count towards both.This pull request removes 1754 skipped tests and adds 1754 skipped tests. Note that renamed tests count towards both. |
|
This is addressed in release v4.2.1. |

This PR ensures that directories with trailing slashes are properly enumerated.
GetFileNamein enumeration