| Crates.io | runs |
| lib.rs | runs |
| version | 0.2.1 |
| created_at | 2025-06-30 20:46:36.667199+00 |
| updated_at | 2025-07-23 15:06:37.248345+00 |
| description | A CLI tool to run Rust documentation tests (doctests) on standalone .rs files by generating a temporary Cargo project. |
| homepage | |
| repository | https://github.com/2teez/runs |
| max_upload_size | |
| id | 1732355 |
| size | 14,986 |
runs โ Run Rust Doctests on Standalone Filesruns lets you execute Rust documentation tests (doctests) on a standalone .rs file, even if it's not part of a full Cargo project.
Normally,
cargo test --docworks only inside valid Cargo projects.runsbridges this limitation.
.rs file with doctestscargo test --doc on the filecargo install runs
git clone https://github.com/2teez/runs.git
cd runs
cargo install --path .
runs my_script.rs
This will:
Create a temp project: my_script_proj/
Copy my_script.rs into src/lib.rs
Generate Cargo.toml
Run cargo test --doc
Delete the project
Print results to your terminal
๐ Example
/// Add two numbers.
///
/// ```
/// use math_proj::add;
/// assert_eq!(add(2, 3), 5);
/// ```
pub fn add<T: std::ops::Add<Output = T>>(a: T, b: T) -> T {
a + b
}
runs math.rs
The version was increased from 0.1.1 to 0.1.2, because the fn keyword is made public in the src/lib.rs by runs. So, user doesn't have to do that on their own.
Version 0.2.0, allow the crate runs to run cargo add, adding to the user's project Cargo toml file, the specified crates used on the doctest. The user does NOT have to manually do anymore, like they will do in the previous version.
Version 0.2.1, updated the README file.