2024-05-01 16:42:59 -05:00
|
|
|
//! This test checks rustdoc `-` (stdin) handling
|
|
|
|
|
2024-06-06 14:34:34 -05:00
|
|
|
use std::path::PathBuf;
|
2024-05-01 16:42:59 -05:00
|
|
|
|
2024-06-06 14:34:34 -05:00
|
|
|
use run_make_support::rustdoc;
|
2024-07-28 17:13:50 -05:00
|
|
|
|
2024-05-01 16:42:59 -05:00
|
|
|
static INPUT: &str = r#"
|
|
|
|
//! ```
|
|
|
|
//! dbg!(());
|
|
|
|
//! ```
|
|
|
|
pub struct F;
|
|
|
|
"#;
|
|
|
|
|
|
|
|
fn main() {
|
2024-06-06 14:34:34 -05:00
|
|
|
let out_dir = PathBuf::from("doc");
|
2024-05-01 16:42:59 -05:00
|
|
|
|
|
|
|
// rustdoc -
|
2024-09-04 19:02:32 -05:00
|
|
|
rustdoc().arg("-").out_dir(&out_dir).stdin_buf(INPUT).run();
|
2024-05-01 16:42:59 -05:00
|
|
|
assert!(out_dir.join("rust_out/struct.F.html").try_exists().unwrap());
|
|
|
|
|
|
|
|
// rustdoc --test -
|
2024-09-04 19:02:32 -05:00
|
|
|
rustdoc().arg("--test").arg("-").stdin_buf(INPUT).run();
|
2024-05-01 16:42:59 -05:00
|
|
|
|
|
|
|
// rustdoc file.rs -
|
|
|
|
rustdoc().arg("file.rs").arg("-").run_fail();
|
|
|
|
}
|