Repository navigation
test: make reversed screencopy range explicit - #161
Merged
bea4dev merged 1 commit intoOct 28, 2026
Merged
Conversation
marcoallegretti
marked this pull request as ready for review
October 24, 2026 11:46
Owner
|
thanks! LGTM! |
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.
Problem
The screencopy regression test added in #160 intentionally constructs an inverted range to verify that invalid buffer bounds are rejected without writing to shared memory.
Writing that case as
7..3triggers Clippy’sreversed_empty_rangesdiagnostic when test targets are checked. This prevents the targeted Clippy validation used by #158 from completing after rebasing onto the currentmain.Change
Construct the inverted
Rangeexplicitly and name itreversed_range.The runtime value remains unchanged:
startis7;endis3;start > endrejection path;This keeps the test’s intent visible without adding a lint allowance.
Verification
cargo fmt --all -- --checkcargo test -p shojiwm_lib shm_copy_rejects_invalid_ranges --lockedcargo clippy -p shojiwm_lib --lib --tests --lockedThe combined result with #158 was also checked: its workspace-wide
clippy::needless_borrowvalidation completes successfully once this fix is present.API impact
No API break.
Only the construction of an intentionally invalid value inside a unit test changes. Production behavior is unaffected.
Follow-up to #160. Unblocks #158.