Repository navigation
test: expect whole-pixel glide goals in the reading-keys walk - #6385
Merged
Merged
Conversation
#6364 rounds each glide's goal to a whole pixel and presses add their step to that goal, so three d presses of 482.4 px rest at 1446, not 1447.2. The test now derives each expected position from that rule; the behavior it guards (presses add from the goal, a taken box resets the goal, the foot banks nothing) is unchanged. Refs #3985
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.
#6364 rounds every scroll glide's goal to a whole pixel, and a press made during a glide adds its step to that rounded goal.
test_the_reading_keys_accumulate_and_reversestill expected unrounded multiples of the step. Withd's step of 482.4 px, three presses rest at 482 → 964 → 1446, and the test wanted 1447.2 ± 1. It failed on main in push run 44269587200 withassert 1446 == 1447.1999999999998 ± 1.Only the test changes. Each expected resting place now comes from the rule
glideTostates: round the previous goal plus the step. The ±1 bound stays. What the test guards is unchanged. A second press that measured from a glide still in flight would rest hundreds of pixels short, and one that ignored the user's mid-glide scroll would miss 400 by a whole step. Rounding at each press drifts at most half a pixel per press, which no reader sees, so I kept #6364's rule rather than adding a separate unrounded aim to the glide.Verification: the test fails on main locally with the CI message and passes on this branch, together with
test_the_reading_page_step_never_paints_behind_where_it_started.Refs #3985 — automated triage