Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: IntelliTect/TestTools.Console
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: IntelliTect/TestTools.Console
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: copilot/improve-consoleassert-output
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 4 files changed
  • 1 contributor

Commits on May 13, 2026

  1. 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
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    253aac9 View commit details
    Browse the repository at this point in the history
  2. 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
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    d9b4dc3 View commit details
    Browse the repository at this point in the history
  3. 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
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    04d671d View commit details
    Browse the repository at this point in the history
  4. 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.
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    d71e786 View commit details
    Browse the repository at this point in the history
  5. 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
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    e2c4112 View commit details
    Browse the repository at this point in the history
  6. 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.
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    77f7c29 View commit details
    Browse the repository at this point in the history
  7. 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.
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    d1f0e5a View commit details
    Browse the repository at this point in the history
  8. 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.
    BenjaminMichaelis committed May 13, 2026
    Configuration menu
    Copy the full SHA
    9a58747 View commit details
    Browse the repository at this point in the history
Loading