Add a test for the shortness format in rustdoc

This commit is contained in:
Alexis Bourget 2021-02-04 18:59:42 +01:00
parent 360f8f8b7d
commit 716d2cdecc
2 changed files with 28 additions and 0 deletions

View file

@ -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!");
}

View file

@ -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