rust/tests/run-make/stdin-rustdoc/rmake.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
548 B
Rust
Raw Normal View History

2024-05-01 16:42:59 -05:00
//! This test checks rustdoc `-` (stdin) handling
use std::path::PathBuf;
2024-05-01 16:42:59 -05:00
use run_make_support::rustdoc;
2024-05-01 16:42:59 -05:00
static INPUT: &str = r#"
//! ```
//! dbg!(());
//! ```
pub struct F;
"#;
fn main() {
let out_dir = PathBuf::from("doc");
2024-05-01 16:42:59 -05:00
// rustdoc -
rustdoc().arg("-").out_dir(&out_dir).stdin(INPUT).run();
assert!(out_dir.join("rust_out/struct.F.html").try_exists().unwrap());
// rustdoc --test -
rustdoc().arg("--test").arg("-").stdin(INPUT).run();
// rustdoc file.rs -
rustdoc().arg("file.rs").arg("-").run_fail();
}