Add regression tests for VS16 after zero-width chars in split_graphemes#4007
Merged
willmcgugan merged 2 commits intomasterfrom Feb 19, 2026
Merged
Add regression tests for VS16 after zero-width chars in split_graphemes#4007willmcgugan merged 2 commits intomasterfrom
willmcgugan merged 2 commits intomasterfrom
Conversation
Co-authored-by: willmcgugan <[email protected]>
Copilot
AI
changed the title
[WIP] WIP address feedback on infinite loop fix
Add regression tests for VS16 after zero-width chars in split_graphemes
Feb 19, 2026
willmcgugan
approved these changes
Feb 19, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4007 +/- ##
=======================================
Coverage 97.87% 97.87%
=======================================
Files 96 96
Lines 8370 8370
=======================================
Hits 8192 8192
Misses 178 178
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Type of changes
AI?
AI generated PRs may be accepted, but only if @willmcgugan has responded on an issue or discussion.
Checklist
Description
Addresses missing regression coverage for #4006's infinite loop fix in
split_graphemes. When VS16 (\ufe0f) follows a zero-width character that never setslast_measured_character(e.g. escape\x1bor ZWJ\u200d), the old code would skip theelif last_measured_character:branch entirely, leavingindexunadvanced and causing an infinite loop. The fix (merging theelsebranch) was already in place; this PR adds the tests to lock it in.New parametrized cases in
test_split_graphemes:"\x1b\ufe0f"— VS16 after escape →[(0, 2, 0)], width0"\u200d\ufe0f"— VS16 after ZWJ →[(0, 2, 0)], width0Part of #4006.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.