Skip to content

Improve Test Coverage#982

Merged
fat merged 9 commits into
beta-1.3from
fat/test-coverage
Jul 14, 2026
Merged

Improve Test Coverage#982
fat merged 9 commits into
beta-1.3from
fat/test-coverage

Conversation

@fat

@fat fat commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds three new test suites to packages/diffs/test/ – monaco, codemirror, and atom.

195 new tests across three suites, 30 real bugs encoded.

For expected failsures they marked with test.failing.

In subsequent pr's ill patch the actual failures (1x1) so they're easier to review.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jul 14, 2026 10:34pm
pierre-docs-diffshub Ready Ready Preview Jul 14, 2026 10:34pm
pierre-docs-trees Ready Ready Preview Jul 14, 2026 10:34pm
pierrejs-diff-demo Ready Ready Preview Jul 14, 2026 10:34pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 862146707d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/diffs/test/codemirror-legacy-tests/commands.cm.test.ts Outdated

@necolas necolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs another rebase

Comment thread packages/diffs/test/codemirror-legacy-tests/historyRemote.cm.test.ts Outdated
Comment on lines +58 to +59
- `pieceTable.cm.test.ts` (1): `TextDocument.positionAt` can return a position
strictly inside a CRLF pair (character beyond `getLineLength`) that its own

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to #956

fat and others added 9 commits July 14, 2026 15:31
…CodeMirror

Ports behavioral edge-case scenarios from microsoft/vscode (MIT) and
CodeMirror 6 (MIT) test suites into two new bun:test suites under
packages/diffs/test/. 139 tests, including 22 test.failing entries that
encode real bugs found during the port (frozen EditStack entries vs
non-history edits, undo coalescing, surrogate-pair edit boundaries,
CRLF line metadata, and others). Test-only change; fixes land separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Third legacy-editor harvest, from atom/text-buffer and atom/superstring
(both MIT): 56 tests covering search/replace semantics (regex capture
expansion, zero-width-match termination, replace-past-own-output,
anchored patterns on CRLF), selection remapping under partial-overlap
replacements, soft-wrap boundary behavior, history invariant fuzzing,
and malformed-position handling. Includes 8 test.failing entries
encoding newly found bugs, the worst being: an edit with a NaN position
component silently replaces the entire document, and soft-wrap vertical
caret motion can land inside a surrogate pair.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Intl.Segmenter's isWordLike classification varies across ICU builds
(underscore joining, bare-digit and Han word-ness differ between
engines/platforms). Two segmenter-side expansion pins now probe the
runtime's segmentation of their own fixture and skip visibly on
divergent ICUs instead of failing. Both tests still execute on our dev
and CI environments, which agree with the pinned segmentation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Completes the previous commit: the Chinese, Japanese, and Latin-Katakana
double-click expansion pins depend on the same ICU-variable isWordLike
classification (dictionary-based CJK segmentation is the most
engine-dependent of all), so they get the same runtime probe treatment
via a shared wordLikeSegments helper. Delete-word tests are untouched —
the regex classifier is deterministic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per team feedback: the three editor-named test directories are gone and
all 195 tests now live in the existing per-domain files
(editorPieceTable, editorTextDocument, editorApplyEdits, editorEditStack,
editorSelection, editorSearchPanel, editorWrapCaretPosition).
Migration was audited name-by-name before deletion: every test present
exactly once, all 30 test.failing known-bug pins and 5 ICU skipIf guards
preserved. Comments no longer reference other editors; the conventions,
known-bug inventory, coverage-gap additions, and a single provenance
note moved into test/README.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
resolveIndentEdits inserts the indent unit at column 0 of every line a
multi-line selection touches, including empty and whitespace-only lines,
injecting trailing whitespace on lines the user never typed on. Outdent
round-trips it away, bounding the damage to the indented state. Brings
the pinned known-bug count to 31.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
We don't model programmatic edits as a class distinct from local edits,
so the scenario's premise (a dead history entry after an untracked edit
replaced its region) doesn't match the intended design. The remaining
five history-across-untracked-edits pins stand; pinned known-bug count
returns to 30.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…quivalence

Design decision: edits applied with updateHistory=false are not a
semantic class distinct from local edits — a mixed sequence must behave
exactly like the same sequence applied all-tracked. The old pins
asserted rebasing semantics (untracked edits surviving undo); all are
flipped to equivalence assertions whose expected values mirror an
all-tracked reference run: undo-to-exhaustion restores the original
text, redo-to-exhaustion the final text. The wiped-region test returns
under the new model, and the coalescing-across-an-untracked-edit pin
flipped from passing to failing because its outcome also deviates from
the all-tracked timeline. Cluster: 7 failing pins; suite total 32.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@amadeus amadeus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@fat fat merged commit 1eed037 into beta-1.3 Jul 14, 2026
8 checks passed
@fat fat deleted the fat/test-coverage branch July 14, 2026 22:55
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.

3 participants