-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-doctestsArea: rustdoc --testArea: rustdoc --testCommand-testS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Description
It's surprising that doctests don't work binary targets:
cargo new foo --bin
/// ```rust
/// assert!(false);
/// ```
fn main() {
println!("Hello, world!");
}
cargo test --all
I'd expect the above to fail, but it looks like the doc-comment code is never ran. Even if I explicitly enable doctests for the binary:
[[bin]]
name = "foo"
path = "src/main.rs"
doctest = true
they still aren't run.
huxi, remram44, vi, iago-lito, nanodeath and 28 more
Metadata
Metadata
Assignees
Labels
A-doctestsArea: rustdoc --testArea: rustdoc --testCommand-testS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Type
Projects
Status
No status