Repository navigation
Comparing changes
Open a pull request
base repository: IntelliTect/TestTools.Console
base: main
head repository: IntelliTect/TestTools.Console
compare: copilot/improve-consoleassert-output
- 8 commits
- 4 files changed
- 1 contributor
Commits on May 13, 2026
-
Add detailed wildcard match diff to ConsoleAssert failure output
- Add WildcardMatchAnalyzer to provide line-by-line wildcard diff - Enhance GetMessageText to include detailed wildcard analysis when wildcard matching fails (detected via error message containing 'wildcard') - Skip unhelpful char-by-char diff for wildcard failures - Keep ConsoleAssertException (fix regression from original PR) - Add EnhancedErrorMessageTests and WildcardMatchAnalyzerTests Fixes #69
Configuration menu - View commit details
-
Copy full SHA for 253aac9 - Browse repository at this point
Copy the full SHA 253aac9View commit details -
Fix review findings: netstandard2.0 compat, wildcard extraction, trai…
…ling newline, dead code - ConsoleAssert.cs: use IndexOf(...) >= 0 instead of Contains(string, StringComparison) for netstandard2.0 compatibility; broaden catch to Exception; remove stale TODO comment - WildcardMatchAnalyzer: remove dead Position field from WildcardMatch; make AnalyzeMatch and GenerateDetailedDiff internal (not public); fix ExtractWildcardMatches to not swallow '?' after '*'; fix FindNextLiteralMatch to match full literal prefix (not just first char); fix FindMismatchPosition to remove wildcard skip logic (it's only called for non-wildcards); fix SplitIntoLines to strip single trailing newline from Console.WriteLine output - Tests: remove platform-fragile echo-based ExecuteProcess test; add happy-path test; add '?' failure path, '[...]' character class, '*' at start, and consecutive wildcard tests with proper assertions
Configuration menu - View commit details
-
Copy full SHA for d9b4dc3 - Browse repository at this point
Copy the full SHA d9b4dc3View commit details -
Fix round-2 review findings: compile error, wildcard guard, explicit …
…isWildcardMatching param - WildcardMatchAnalyzer: remove stale duplicate FindNextLiteralMatch signature (build-blocker); guard FindMismatchPosition call to only run on non-wildcard lines (prevents misleading output); add ContainsWildcard helper; fix SplitIntoLines empty-string edge case after stripping newline - ConsoleAssert: replace fragile error-message string-sniffing with explicit isWildcardMatching bool parameter threaded through Expect/ExpectAsync/Execute/ExecuteAsync/CompareOutput/AssertExpectation; all ExpectLike* and ExecuteProcess callers now explicitly pass isWildcardMatching: true
Configuration menu - View commit details
-
Copy full SHA for 04d671d - Browse repository at this point
Copy the full SHA 04d671dView commit details -
Add missing XML doc param tags to prevent CS1573 build errors
TreatWarningsAsErrors=true + GenerateDocumentationFile=true means CS1573 (missing param tag) is a build error. Add isWildcardMatching param tags to: Expect, ExpectAsync, Execute, ExecuteAsync.
Configuration menu - View commit details
-
Copy full SHA for d71e786 - Browse repository at this point
Copy the full SHA d71e786View commit details -
DRY: extract WildcardMismatchMessage constant; remove redundant LikeO…
…perator lambda wrap - Extract repeated 'The values are not like (using wildcards) each other' string into private const WildcardMismatchMessage; replaces 5 duplicate string literals - ExecuteProcess: pass LikeOperator directly instead of wrapping in an identical lambda
Configuration menu - View commit details
-
Copy full SHA for e2c4112 - Browse repository at this point
Copy the full SHA e2c4112View commit details -
DRY follow-ups: collapse * early-returns, EscapeForDisplay delegates …
…to EscapeChar, extract test helpers - WildcardMatchAnalyzer: collapse two identical early-exit paths in ExtractWildcardMatches into one combined condition (nextPatternPos >= Length || nextLiteralIndex == -1); compute FindNextLiteralMatch once before the guard. - WildcardMatchAnalyzer: EscapeForDisplay now iterates chars and delegates to EscapeChar via StringBuilder, eliminating three chained .Replace calls. - EnhancedErrorMessageTests: extract GetMismatchMessage() helper used by three tests. - WildcardMatchAnalyzerTests: extract GetDiff() helper used by two GenerateDetailedDiff tests.
Configuration menu - View commit details
-
Copy full SHA for 77f7c29 - Browse repository at this point
Copy the full SHA 77f7c29View commit details -
Fix round-5 review: restore Execute params, fix StarAtStart assertion…
…, guard length-mismatch for wildcards - ConsoleAssert.cs: Execute() was missing 'string expectedOutput' and 'Action action' parameters (accidentally dropped during isWildcardMatching threading). Build was broken with CS1501 + two CS0103 errors. Restored both parameters. - ConsoleAssert.cs: Guard the length-mismatch message with !isWildcardMatching so that pattern-vs-output length comparisons are not shown for wildcard failures (misleading: pattern length is semantically unrelated to match success). - WildcardMatchAnalyzerTests.cs: AnalyzeMatch_StarAtStart_MatchesLeadingText expected 'long prefix ' (trailing space) but FindNextLiteralMatch anchors on ' end' so '*' captures 'long prefix' without the space. Corrected assertion.
Configuration menu - View commit details
-
Copy full SHA for d1f0e5a - Browse repository at this point
Copy the full SHA d1f0e5aView commit details -
Address Copilot PR reviewer feedback
- Thread escapeCharacter through full call chain so WildcardMatchAnalyzer uses the same escape semantics as the assertion (e.g. '\*' treated as literal '*' when escapeCharacter='\'). Chain: ExpectLike* -> Expect/ ExpectAsync -> Execute/ExecuteAsync -> CompareOutput -> AssertExpectation -> GetMessageText -> WildcardMatchAnalyzer.AnalyzeMatch -> MatchLineWithWildcards -> WildcardPattern(pattern, escapeCharacter). - Fix stale XML doc comment in ExtractWildcardMatches: the 'known limitation' claimed '?' after '*' is absorbed into the '*' match, but the implementation actually records '*' as empty and '?' as its own entry. Updated to document the actual behavior. - Remove stray ')' in char mismatch message format string (pre-existing typo in ConsoleAssert.GetMessageText). - Narrow broad catch(Exception) to catch(Exception) when not OutOfMemoryException so fatal/runtime exceptions are not swallowed while building the wildcard diff diagnostic message.
Configuration menu - View commit details
-
Copy full SHA for 9a58747 - Browse repository at this point
Copy the full SHA 9a58747View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...copilot/improve-consoleassert-output