Skip to content

Extract remaining crowded compiler tests (Phase 3)#42

Merged
aaltshuler merged 1 commit into
mainfrom
refactor/extract-compiler-tests-p3
Apr 20, 2026
Merged

Extract remaining crowded compiler tests (Phase 3)#42
aaltshuler merged 1 commit into
mainfrom
refactor/extract-compiler-tests-p3

Conversation

@aaltshuler

Copy link
Copy Markdown
Collaborator

Summary

Phase 3 of the test refactor. Extends the #[path] sibling pattern from PR #41 to the remaining compiler files where inline tests crowded out production code. Cutoff: test/prod ratio ≥ 0.8. Files where production dominates stay inline — extracting them would add noise without reducing it.

file prod test ratio verdict
ir/lower.rs 575 662 1.15 extract
catalog/mod.rs 324 268 0.83 extract
query/lint.rs 312 248 0.80 extract
query_input.rs 763 254 0.33 leave
schema_plan.rs 729 166 0.23 leave

catalog/tests.rs uses the shorter name since it lives inside a module directory — no ambiguity with a filename-derived sibling (like lower_tests.rs next to lower.rs).

Test plan

  • cargo test -p omnigraph-compiler — 229 tests green, identical count to before
  • Verified each sibling: opens with use super::*;, only mechanical 4-space de-indent

🤖 Generated with Claude Code

Files where inline tests crowded out production code (test/prod ratio
≥ 0.8) move to sibling files via `#[path]`. Files where production
dominates (query_input.rs, schema_plan.rs) stay inline — extracting
would add noise, not reduce it.

- ir/lower.rs: 1239 → 577 lines (ratio 1.15)
- catalog/mod.rs: 594 → 326 lines (ratio 0.83)
- query/lint.rs: 562 → 314 lines (ratio 0.80)

catalog/tests.rs uses the shorter name since it's inside a module
directory (no ambiguity with filename).

All 229 compiler tests green, identical count to before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aaltshuler aaltshuler merged commit 674eee1 into main Apr 20, 2026
4 checks passed
@aaltshuler aaltshuler deleted the refactor/extract-compiler-tests-p3 branch April 20, 2026 20:09
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