Skip to content

fix(resolution): production code never names a test suite's symbol - #2209

Merged
colbymchenry merged 1 commit into
mainfrom
fix/prod-never-test-suite
Sep 30, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
fix/prod-never-test-suite

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

A test suite isn't linked into the program, so a name match from production code into one is coincidence. Until now only Strategy 3's receiver guess (#2171) ruled that out. Now no strategy's name match reaches a symbol in a test suite from a non-test file.

A test suite here means:

  • a test source set (src/test/, jvmTest/);
  • a tests/, __tests__/, spec/ or e2e/ directory;
  • a FooTest.kt, test_foo.py, foo.test.ts or foo_spec.rb file.

Test-support code a project ships (testing/, fakes/, mocks/, a *-test module) stays in reach. …Spec.java files (halo's IndexSpecs, okhttp's ConnectionSpec), post-spec.ts models and useTests.ts hooks aren't treated as test suites.

Measured (wasm, main vs fix; losses only)

repo edges examples
kotlinx.coroutines −318 import kotlinx.coroutines.* onto one test file's package node
okhttp −164 117 sample @Override → a test's nested Override
Exposed −92 a test's StubRow.getObject, FixedClock.now
typeorm −64 Record<K, V> → a test entity
sttp −62 a test's LazyMonad.flatMap
element-plus −36 isClient → a test's vueuse mock
excalidraw −10 actionManager.executeAction → the test API helper
tokio / trpc / AutoMapper / netbox / cats / mealie / pytest / Alamofire −30 / −36 / −37 / −22 / −21 / −10 / −8 / −7
halo, zod, eShop, react-native-reusables unchanged

Test plan

  • __tests__/prod-to-test-suite.test.ts (fails on main; testing/ support and test→test guards)
  • Full suite: 403 files / 5714 tests passed

🤖 Generated with Claude Code

A test suite is not linked into the program, so a name match from
production code into one is coincidence - but only Strategy 3's receiver
guess (#2171) ruled it out. Now no strategy's name match reaches a symbol
in a test suite from a non-test file: a test source set (`src/test/`,
`jvmTest/`), a `tests/` / `__tests__/` / `spec/` / `e2e/` directory, a
`FooTest.kt` / `test_foo.py` / `foo.test.ts` / `foo_spec.rb` file.
Test-support code a project ships - `testing/`, `fakes/`, `mocks/`, a
`*-test` module - stays in reach, and `…Spec.java` (halo's `IndexSpecs`,
okhttp's `ConnectionSpec`), `post-spec.ts` models and `useTests.ts` hooks
are not test suites.

typeorm -64 (`Record<K, V>` -> a test entity), okhttp -164 (117 sample
`@Override` -> a test's nested `Override`), kotlinx.coroutines -318
(`import kotlinx.coroutines.*` onto one test file's package node), sttp -62,
Exposed -92, halo 0, element-plus -36 (`isClient` -> a test's vueuse mock),
excalidraw -10 (`actionManager.executeAction` -> the test `API` helper),
tokio -30, trpc -36, AutoMapper -37, netbox -22, cats -21, mealie -10,
pytest -8, Alamofire -7; zod, eShop, react-native-reusables unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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