Open
Conversation
Contributor
Author
|
On second glance it looks like the Parley PR added tests, so probably didn't miss a failing one. Another potential cause could be ec9024f changing two things that directly affect wrapping in the test:
|
The test hardcoded expected vline numbers (`4`, `5`) that assumed character `d` at offset 16 would land exactly at a soft wrap boundary at width 36px. The fix discovers the actual wrap boundaries at runtime and asserts the property the test was always meant to verify: at a soft wrap boundary, `Forward` affinity resolves to the next visual line and `Backward` resolves to the previous one. A guard assertion ensures the test fixture still produces at least one soft wrap, so it can't pass vacuously.
d544fa1 to
e961570
Compare
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.
The test hardcoded expected vline numbers (
4,5) that assumed characterdat offset 16 would land exactly at a soft wrap boundary at width 36px.Hypothesis: These values depended on specific font metrics from the pre-Parley text layout engine. After the Parley integration, SansSerif at 12pt renders with slightly different character widths, shifting the wrap point sodno longer starts a new visual line.Rather than adjusting the magic numbers to match Parley's metrics (which would break again on the next layout engine or font change),the fix discovers the actual wrap boundaries at runtime and asserts the property the test was always meant to verify: at a soft wrap boundary,Forwardaffinity resolves to the next visual line andBackwardresolves to the previous one. A guard assertion ensures the test fixture still produces at least one soft wrap, so it can't pass vacuously.