Repository navigation
Conversation
Fixes vyncint#851 Signed-off-by: Álvaro Alonso <242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com>
vyncint
previously approved these changes
Nov 27, 2026
vyncint
left a comment
Owner
There was a problem hiding this comment.
Reviewed against the issue; CI is green. Thank you.
Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> # Conflicts: # CHANGELOG.md
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.
Fixes #851
assert_screen_snapshot!handed insta its own binding, so insta'sstringify!recorded__screen.with_styles()or__screenas every snapshot'sexpression, and a failure summary showed the same name.crates/termlens/src/lib.rs: each arm passesstringify!($source)as insta's debug expression. The file forms useassert_snapshot!(None::<String>, value, stringify!($source)), as the issue suggests, which keeps the auto-generated file name; the inline form usesassert_snapshot!(value, stringify!($source), @$inline). Soassert_screen_snapshot!(t, after = …)recordsexpression: tandassert_screen_snapshot!(t.screen(), styles = false)recordsexpression: t.screen()..snapfiles the macro writes in this repo (snapshot_macroandreadme_example) get their newexpression:line. Only that header line changes; the contents are the same.CI=1 INSTA_REQUIRE_FULL_MATCH=1 cargo test -p termlens --all-features --test snapshot_macro --test readme_example: it passes with this change and fails with main's macro against the updated files. I also checked that the inline form (assert_screen_snapshot!(t, @"")) compiles and runs. If you want CI to pin the header,require_full_matchcould be turned on for those two tests; I left that to you, since it changes insta's behaviour for the whole repo.cargo insta test --force-update-snapshotsrewrites their header.Checked on macOS:
cargo fmt --all --check,cargo clippy -p termlens --all-targets --all-features -- -D warnings, the two test files above,check-dco.shandcheck-no-ai-attribution.sh.Álvaro Alonso
242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com