Skip to content

Extract compiler test modules to sibling files (Phase 2)#41

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

Extract compiler test modules to sibling files (Phase 2)#41
aaltshuler merged 1 commit into
mainfrom
refactor/extract-compiler-tests

Conversation

@aaltshuler

Copy link
Copy Markdown
Collaborator

Summary

Phase 2 of the test refactor. Three compiler files had ~1000-line inline mod tests blocks that overshadowed the production code above them. Moved each to a sibling *_tests.rs file using the standard #[path = \"...\"] mod tests; pattern.

file before after sibling
query/typecheck.rs 2865 1708 typecheck_tests.rs (1156)
schema/parser.rs 1950 994 parser_tests.rs (955)
query/parser.rs 1737 803 parser_tests.rs (933)

No visibility change — the sibling module still has use super::* access to crate-privates. Only semantic edit is mechanical de-indentation by 4 spaces.

Test plan

  • cargo test -p omnigraph-compiler — all 229 tests green, identical count to before
  • cargo build --workspace --tests — clean
  • Verified each sibling file: opens with use super::*;, ends at the last test's closing }

🤖 Generated with Claude Code

typecheck.rs, schema/parser.rs, and query/parser.rs each had
~1000-line inline `mod tests` blocks that overshadowed the production
code in the file. Move each to a sibling `*_tests.rs` using
`#[path = "..."] mod tests;`.

- typecheck.rs: 2865 → 1708 lines; typecheck_tests.rs: 1156 lines
- schema/parser.rs: 1950 → 994 lines; parser_tests.rs: 955 lines
- query/parser.rs: 1737 → 803 lines; parser_tests.rs: 933 lines

No visibility change — the sibling module still has `use super::*`
access to crate-privates. No semantic edits beyond de-indenting by
4 spaces (mechanical). 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 f2c3b11 into main Apr 20, 2026
4 checks passed
@aaltshuler aaltshuler deleted the refactor/extract-compiler-tests branch April 20, 2026 16:15
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