Add Path.AreEqual static extension method - #88
Merged
Conversation
Copilot created this pull request from a session on behalf of
Tyrrrz
July 16, 2026 12:49
View session
Tyrrrz
marked this pull request as ready for review
July 16, 2026 12:51
Tyrrrz
reviewed
Jul 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Path.AreEqual(string?, string?) static extension member to the existing PathExtensions extension block, providing a normalized, OS-aware path equality check (case-insensitive on Windows, case-sensitive elsewhere), and introduces unit tests for the new API.
Changes:
- Added
Path.AreEqual(string?, string?)that normalizes inputs viaPath.GetFullPath+Path.TrimEndingDirectorySeparatorbefore comparing. - Added unit tests for null handling and basic normalization cases (trailing separators,
./..segments).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| PowerKit/Extensions/PathExtensions.cs | Adds Path.AreEqual implementation with normalization + OS-specific string comparison. |
| PowerKit.Tests/Extensions/PathExtensionsTests.cs | Adds tests for the new Path.AreEqual API behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Tyrrrz
reviewed
Jul 16, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #88 +/- ##
==========================================
+ Coverage 86.25% 86.35% +0.09%
==========================================
Files 74 74
Lines 1244 1253 +9
Branches 231 234 +3
==========================================
+ Hits 1073 1082 +9
Misses 121 121
Partials 50 50 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 1, 2026
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
Path.AreEqualstatic extension method for comparing two paths for equality, which was missing from thePathExtensionsclass.Changes
PathExtensions.cs— newPath.AreEqual(string?, string?)method that:Path.GetFullPath+Path.TrimEndingDirectorySeparator(handles./..segments and trailing separators)OrdinalIgnoreCaseon Windows,Ordinalelsewherenullinputs (both null →true, one null →false)PathExtensionsTests.cs— tests covering null handling, trailing slashes, and path normalizationExample