Skip to content

Commit

Permalink
Add test for --display-doctest-warnings option
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 14, 2021
1 parent 3a8fcff commit b531a7f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/rustdoc-ui/display-output.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// check-pass
// compile-flags:-Zunstable-options --display-doctest-warnings --test
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// let x = 12;
/// ```
pub fn foo() {}
24 changes: 24 additions & 0 deletions src/test/rustdoc-ui/display-output.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

running 1 test
test $DIR/display-output.rs - foo (line 6) ... ok

successes:

---- $DIR/display-output.rs - foo (line 6) stdout ----
warning: unused variable: `x`
--> $DIR/display-output.rs:7:5
|
LL | let x = 12;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted



successes:
$DIR/display-output.rs - foo (line 6)

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME

0 comments on commit b531a7f

Please sign in to comment.