Skip to content

Commit b531a7f

Browse files
Add test for --display-doctest-warnings option
1 parent 3a8fcff commit b531a7f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/test/rustdoc-ui/display-output.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// check-pass
2+
// compile-flags:-Zunstable-options --display-doctest-warnings --test
3+
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
4+
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
6+
/// ```
7+
/// let x = 12;
8+
/// ```
9+
pub fn foo() {}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
running 1 test
3+
test $DIR/display-output.rs - foo (line 6) ... ok
4+
5+
successes:
6+
7+
---- $DIR/display-output.rs - foo (line 6) stdout ----
8+
warning: unused variable: `x`
9+
--> $DIR/display-output.rs:7:5
10+
|
11+
LL | let x = 12;
12+
| ^ help: if this is intentional, prefix it with an underscore: `_x`
13+
|
14+
= note: `#[warn(unused_variables)]` on by default
15+
16+
warning: 1 warning emitted
17+
18+
19+
20+
successes:
21+
$DIR/display-output.rs - foo (line 6)
22+
23+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
24+

0 commit comments

Comments
 (0)