refactor: move unit tests into <module>_tests.rs files - #210
Merged
Merged
Conversation
This was referenced Sep 24, 2026
tupe12334
marked this pull request as ready for review
September 24, 2026 08:14
Each module's inline `mod tests { ... }` now lives in a sibling
`<module>_tests.rs` (property tests in `<module>_proptest_tests.rs`),
declared with `#[path]` so test names and privacy are unchanged.
- `autobins = false` so src/bin/main_tests.rs is not built as a binary.
- Rename the cel_eval proptest regression file to match its new source.
- Document the layout in CONTRIBUTING.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tupe12334
force-pushed
the
refactor/extract-unit-tests
branch
from
September 24, 2026 08:15
e5e5b81 to
a6b979c
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tupe12334
force-pushed
the
refactor/extract-unit-tests
branch
from
September 24, 2026 08:19
a6b979c to
18c40e4
Compare
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
Follow-up to #209 (review request: "extract the tests to
<x>_tests.rsfiles"). Originally stacked on #209; now rebased ontomainafter #209 merged.#[cfg(test)] mod tests { ... }incore/src/now lives in a sibling<module>_tests.rs, declared as#[cfg(test)] #[path = "<module>_tests.rs"] mod tests;. Test names,use super::*access to private items, and the#[allow(...)]attributes are unchanged.proptest_testsmodules incel_evalandflowgo to<module>_proptest_tests.rs.proptest-regressions/cel_eval.txtis renamed tocel_eval_proptest_tests.txt, because proptest locates regression files by source path.src/bin/main.rstests go tosrc/bin/main_tests.rs. I addedautobins = falseso Cargo doesn't try to build that file as a second binary. The explicit[[bin]] steplocktarget is unchanged.clippy::items_after_statementsis nowdeny(no existing violations).No test logic changed. The only edits are moving code and letting
rustfmtre-indent it.Test plan
cargo testpasses with the same counts as before the move (112 lib, 25 bin, 16 cli, 11 integration)cargo clippy --all-targets -- -D warningspassescargo fmt -- --checkpassesRUSTDOCFLAGS="-D warnings" cargo doc --no-depspassescargo package --listincludes all 12*_tests.rsfiles🤖 Generated with Claude Code