Skip to content

Compare snapshots with whitespace significant - #773

Merged
SimonCropp merged 2 commits into
mainfrom
fix-diffrows-ignores-whitespace
Aug 21, 2026
Merged

Compare snapshots with whitespace significant#773
SimonCropp merged 2 commits into
mainfrom
fix-diffrows-ignores-whitespace

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

DiffPlex's ignoreWhiteSpace parameter defaults to true, so DiffRows was asking for a diff that treats indentation and trailing space as nothing. A snapshot failing only on whitespace came back Unchanged on every row: the panes drew no markers, NextChange found nothing to move to, and the reviewer was shown a failing test with no visible difference and no way to see what it was.

That is not an edge case here. The F# layout convention is entirely about leading whitespace, and trailing space is a common snapshot failure.

Pass ignoreWhiteSpace: false and ignoreCase: false explicitly, so both are stated rather than inherited. No existing snapshot changed, which is the other half of the result: whitespace sensitivity only adds differences that were being hidden.

DiffPlex's ignoreWhiteSpace parameter defaults to true, so DiffRows was asking
for a diff that treats indentation and trailing space as nothing. A snapshot
failing only on whitespace came back Unchanged on every row: the panes drew no
markers, NextChange found nothing to move to, and the reviewer was shown a
failing test with no visible difference and no way to see what it was.

That is not an edge case here. The F# layout convention is entirely about
leading whitespace, and trailing space is a common snapshot failure.

Pass ignoreWhiteSpace: false and ignoreCase: false explicitly, so both are
stated rather than inherited. No existing snapshot changed, which is the other
half of the result: whitespace sensitivity only adds differences that were
being hidden.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 21, 2026
@SimonCropp
SimonCropp merged commit 0288c20 into main Aug 21, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-diffrows-ignores-whitespace branch August 21, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant