Skip to content

test(intl): cover Segmenter surrogate-pair boundaries - #112

Merged
steipete merged 1 commit into
mainfrom
claude/w141-segmenter
Oct 4, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/w141-segmenter

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown

Cover Intl.Segments.containing() at every UTF-16 code-unit offset in a mixed Unicode corpus, in both lookup directions and for grapheme, word and sentence segmentation. The corpus includes surrogate pairs, flags, combining emoji, ZWJ sequences, an unpaired surrogate and ASCII, with out-of-range checks.

The old engine returns the preceding segment for some surrogate-pair offsets. Comparing with iteration also checks segment indices, original input and word status. The engine correction is the port of oven-sh/WebKit#753; thanks @robobun. Requires OpenClaw WebKit. Related oven-sh#44432 remains open; no duplicate upstream PR is needed.

Before: all three added cases fail on old-engine Bun, while Node 24 passes the same corpus. After: all three added cases pass, and the full Intl suite passes all 44 cases. The fully integrated native build passes 873 surrounding tests with 4 skips, 61 todos and zero failures across 22 files. The expanded plain selection is 47/47 with zero regressions, and all four requested OpenClaw consumers pass on that same binary. The final branch passes scoped Codex P2 review. Both exact-head CI lanes pass: Linux x64 and macOS arm64.

Native proof was built at bfe801e73fb70638c053bcbf5ea887e26565cdb2. Final head 3d1f4d51a054f29cf7003ce23fced664de7189e1 differs only by the inherited Rust safety comment from #110 and Node-oracle explanation from #111. Strict source comparison confirms unchanged runtime logic and test assertions.

Requires OpenClaw WebKit with the oven-sh/WebKit#753 port. Check containing() against iteration across both halves of surrogate pairs, all three granularities and both lookup directions.

Co-authored-by: robobun <117481402+robobun@users.noreply.github.com>
@steipete
steipete merged commit bf0b6cd into main Oct 4, 2026
7 of 8 checks passed
@steipete
steipete deleted the claude/w141-segmenter branch October 4, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant