ejectest
Extract inline #[cfg(test)] mod tests { ... } into separate _tests.rs files.
Why?
Inline tests are convenient — until your files grow too large. Manually moving tests to a separate file means editing the source and creating a new test file with the right module path. That's busywork. ejectest does it in one command.
Install
Or download a pre-built binary from the latest release.
Usage
Library usage
Add to your Cargo.toml with default features disabled:
= { = "0.1", = false }
let result = eject_tests?;
// result.modified_source — source with tests replaced by a #[path] stub
// result.test_content — extracted test file contents
// result.test_file_name — e.g. "lib_tests.rs"
Contributing
See CONTRIBUTING.md for development setup and coding conventions.
License
MIT