Extract compiler test modules to sibling files (Phase 2)#41
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 of the test refactor. Three compiler files had ~1000-line inline
mod testsblocks that overshadowed the production code above them. Moved each to a sibling*_tests.rsfile using the standard#[path = \"...\"] mod tests;pattern.query/typecheck.rstypecheck_tests.rs(1156)schema/parser.rsparser_tests.rs(955)query/parser.rsparser_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 beforecargo build --workspace --tests— cleanuse super::*;, ends at the last test's closing}🤖 Generated with Claude Code