]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-ui/failed-doctest-output.rs
Auto merge of #92686 - saethlin:unsafe-debug-asserts, r=Amanieu
[rust.git] / src / test / rustdoc-ui / failed-doctest-output.rs
1 // Issue #51162: A failed doctest was not printing its stdout/stderr
2 // FIXME: if/when the output of the test harness can be tested on its own, this test should be
3 // adapted to use that, and that normalize line can go away
4
5 // compile-flags:--test --test-args --test-threads=1
6 // rustc-env:RUST_BACKTRACE=0
7 // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
8 // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
9 // failure-status: 101
10
11 // doctest fails at runtime
12 /// ```
13 /// println!("stdout 1");
14 /// eprintln!("stderr 1");
15 /// println!("stdout 2");
16 /// eprintln!("stderr 2");
17 /// panic!("oh no");
18 /// ```
19 pub struct SomeStruct;
20
21 // doctest fails at compile time
22 /// ```
23 /// no
24 /// ```
25 pub struct OtherStruct;