Skip to content

Commit

Permalink
Add a test for the shortness format in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Feb 4, 2021
1 parent 360f8f8 commit 716d2cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/rustdoc-ui/issue-81662-shortness.rs
@@ -0,0 +1,12 @@
// compile-flags:--test --error-format=short
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
// failure-status: 101

/// ```rust
/// foo();
/// ```
//~^^ ERROR cannot find function `foo` in this scope
fn foo() {
println!("Hello, world!");
}
16 changes: 16 additions & 0 deletions src/test/rustdoc-ui/issue-81662-shortness.stdout
@@ -0,0 +1,16 @@

running 1 test
test $DIR/issue-81662-shortness.rs - foo (line 6) ... FAILED

failures:

---- $DIR/issue-81662-shortness.rs - foo (line 6) stdout ----
$DIR/issue-81662-shortness.rs:7:1: error[E0425]: cannot find function `foo` in this scope
error: aborting due to previous error
Couldn't compile the test.

failures:
$DIR/issue-81662-shortness.rs - foo (line 6)

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

0 comments on commit 716d2cd

Please sign in to comment.