Skip to content

mac: CompletionTests no longer traps on an empty suggestions array (#773) - #782

Merged
d-q222 merged 1 commit into
mainfrom
agent/daniel-muse-lead/completiontests-empty-array
Sep 17, 2026
Merged

d-q222 merged 1 commit into
mainfrom
agent/daniel-muse-lead/completiontests-empty-array

Conversation

@d-q222

@d-q222 d-q222 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #773.

Test plan

  • swift build --build-tests (apps/mac) — clean
  • swift test --filter CompletionTests — 38/38 pass, 0 failures, no trap

Commit-Executor: daniel-muse-lead (Claude Sonnet)

🤖 Generated with Claude Code

)

`testEnvironmentSnippetKeepsIndentationAndClosingStaysExact` indexed
`s[0]`/`c[0]` right after asserting on the array's contents; a failed
XCTAssertEqual doesn't stop execution, so if either array were ever empty
the next line's array subscript traps and kills the whole xctest process
instead of failing one assertion — exactly the mechanism that hid half the
Mac suite for a day (see #681, #772). Switched both to the `.first?`
idiom the same function already uses for its third suggestions array
(`e`, two lines below), so an unexpected empty result fails the specific
assertion instead of crashing the process.

Verified: `swift build --build-tests` clean; `swift test --filter
CompletionTests` — 38/38 pass, 0 failures, no trap.

Commit-Executor: daniel-muse-lead (Claude Sonnet)
@d-q222
d-q222 merged commit a88876f into main Sep 17, 2026
19 of 21 checks passed
d-q222 added a commit that referenced this pull request Sep 17, 2026
 #784

All eight independently reviewed APPROVE. Batch verification: compiler
935/0, render-pipeline 487/0, perf-bench 14/0, perf gate OK (270 metrics,
no regression), swift build --build-tests OK, CompletionTests 29/0.

Commit-Executor: daniel-parent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…t run (flash-tex#773)

A non-halting XCTAssert followed by unguarded indexing or force-unwrap
trapped the process on a product regression, hiding every later result.
CompletionTests now guard their indexing; the Nearby* waitUntil and
lines(atLeast:) helpers now throw instead of only recording XCTFail,
which caused the NearbyBoundedTransportTests index crash under load.
CompletionTests.swift:314 is left to flash-tex#782.

Implementation-Agent: claude-sonnet-5 subagent of daniel-parent
Commit-Executor: daniel-parent
Co-authored-by: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.

CompletionTests.swift:314 indexes s[0] on possibly-empty suggestions — traps and kills the test process

1 participant