Show a text diff in the exception message for a text mismatch - #1947
Merged
Merged
Conversation
When two bumps edit adjacent lines in Directory.Packages.props, the second can't be merged after the first lands, and gh pr merge failed the run. Dependabot rebases conflicting PRs itself and the rebase reruns Build, so log a warning and exit instead of failing.
When a text file does not match and no string comparer supplied a message, the exception now shows a line diff from DiffEngine's TextDiff.Format rather than the received and verified text in full. The format is set with VerifierSettings.UseTextDiffFormat (Compact by default, Full or Minimal), and VerifierSettings.DisableTextDiff restores the full text. A comparer's message still takes precedence, and texts that differ only in line endings fall back to the full text. Bumps DiffEngine to 20.6.0, which adds TextDiff.
This was referenced Sep 30, 2026
Closed
This was referenced Sep 30, 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.
When a text snapshot doesn't match and no string comparer returned a message, the exception now shows a line diff instead of both texts in full. The diff comes from DiffEngine's new
TextDiff.Format(VerifyTests/DiffEngine#909, released in 20.6.0). This gives the equivalent of Verify.DiffPlex without installing it.Settings
VerifierSettings.UseTextDiffFormat(TextDiffFormat):Compact(the default),FullorMinimal. These match Verify.DiffPlex'sOutputTypelayouts.VerifierSettings.DisableTextDiff(): show both texts in full, as before.Behaviour
VerifyExceptionMessageBuilder, not in a default string comparer, so it doesn't change how equality is decided.Other changes
exception-message-format. Theverify-optionstext and the Verify.DiffPlex entry incomparerare updated.Tests
VerifyExceptionMessageBuilderTestscover each format, the diff disabled, a whitespace-only change, and the line-endings fallback.Diff:block.