-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
It's surprising that doctests sometimes don't run at all, and there's no warning about this.
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.
(moved from rust-lang/cargo#5477)
frol, frewsxcv, vi, nathankleyn, mibac138 and 119 more
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Status
No status