Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --require-full-match on inline snapshots with leading newlines #639

Merged

Conversation

max-sixty
Copy link
Collaborator

@max-sixty max-sixty commented Oct 5, 2024

Otherwise --force-update-snapshots would never be satisfied.

Note comment inline: rather than spend more time on this, let's just try and get one of those two in:

                // Note that we previously would match the exact values of the
                // unnormalized text. But that's too strict — it means we can
                // never match a snapshot that has leading/trailing whitespace.
                // So instead we check it matches on the latest format.
                // Generally those should be the same — latest should be doing
                // the minimum normalization; if they diverge we could update
                // this to be stricter.
                //
                // (I think to do this perfectly, we'd want to match the
                // _reference_ value unnormalized, but the _generated_ value
                // normalized. That way, we can get the But at the moment we
                // don't distinguish between which is which in our data
                // structures.)

Otherwise `--force-update-snapshots` would never be satisfied.
@max-sixty max-sixty merged commit 5320d5c into mitsuhiko:master Oct 5, 2024
15 checks passed
@max-sixty max-sixty deleted the fix-require-full-match-linebreaks branch October 5, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant