rust/tests/run-make/stdin-rustdoc/rmake.rs
2024-06-07 11:12:24 +02:00

26 lines
547 B
Rust

//! This test checks rustdoc `-` (stdin) handling
use run_make_support::rustdoc;
use std::path::PathBuf;
static INPUT: &str = r#"
//! ```
//! dbg!(());
//! ```
pub struct F;
"#;
fn main() {
let out_dir = PathBuf::from("doc");
// 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();
}