about summary refs log tree commit diff
path: root/tests/run-make/stdin-rustdoc/rmake.rs
blob: 584a610ed63fe683db537e0ce15264d6847e779a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! This test checks rustdoc `-` (stdin) handling

use run_make_support::{rustdoc, tmp_dir};

static INPUT: &str = r#"
//! ```
//! dbg!(());
//! ```
pub struct F;
"#;

fn main() {
    let tmp_dir = tmp_dir();
    let out_dir = tmp_dir.join("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();
}