feat: improve visualization of string difference for suffix#764
feat: improve visualization of string difference for suffix#764
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves string difference visualization for suffix matching by adding proper context for prefix/suffix comparisons and enhancing string difference handling. The change addresses issue #702 by making error messages more specific about whether differences are being checked as prefixes or suffixes.
- Adds new
MatchType.PrefixandMatchType.Suffixenum values to distinguish different comparison modes - Implements suffix-specific string difference calculation that compares from the end of strings
- Updates test expectations to show clearer error messages with "expected prefix" and "expected suffix" labels
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
StringDifference.cs |
Core implementation adding suffix match type, index calculation from end, and improved visualization |
StringEqualityOptions.SuffixMatchType.cs |
Updated to use new suffix match type for more accurate error reporting |
StringEqualityOptions.PrefixMatchType.cs |
Updated to use new prefix match type for consistent handling |
ThatString.StartsWith.cs |
Removed inline constraint class (likely moved to shared location) |
ThatString.EndsWith.cs |
Removed inline constraint class (likely moved to shared location) |
| API test files | Updated to include new enum values in public API |
| Test files | Updated expected error messages to show "expected prefix" and "expected suffix" labels |
|
Test Results 4 files - 34 4 suites - 34 17s ⏱️ - 4m 13s Results for commit 5ba2f4b. ± Comparison against base commit 4dc12c1. This pull request removes 16533 and adds 93 tests. Note that renamed tests count towards both. |
🚀 Benchmark ResultsDetails
|
|
This is addressed in release v2.23.0. |



This PR improves string difference visualization for suffix matching by adding proper context for prefix/suffix comparisons and enhancing string difference handling. The change makes error messages more specific about whether differences are being checked as prefixes or suffixes.
Key changes:
MatchType.PrefixandMatchType.Suffixenum values to distinguish different comparison modesStartsWithandEndsWith#702