rust/tests/run-make/stdin-rustdoc/rmake.rs
Nicholas Nethercote 84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00

27 lines
548 B
Rust

//! This test checks rustdoc `-` (stdin) handling
use std::path::PathBuf;
use run_make_support::rustdoc;
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();
}