Skip to content

Commit 716d2cd

Browse files
committed
Add a test for the shortness format in rustdoc
1 parent 360f8f8 commit 716d2cd

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags:--test --error-format=short
2+
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
3+
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
4+
// failure-status: 101
5+
6+
/// ```rust
7+
/// foo();
8+
/// ```
9+
//~^^ ERROR cannot find function `foo` in this scope
10+
fn foo() {
11+
println!("Hello, world!");
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
running 1 test
3+
test $DIR/issue-81662-shortness.rs - foo (line 6) ... FAILED
4+
5+
failures:
6+
7+
---- $DIR/issue-81662-shortness.rs - foo (line 6) stdout ----
8+
$DIR/issue-81662-shortness.rs:7:1: error[E0425]: cannot find function `foo` in this scope
9+
error: aborting due to previous error
10+
Couldn't compile the test.
11+
12+
failures:
13+
$DIR/issue-81662-shortness.rs - foo (line 6)
14+
15+
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
16+

0 commit comments

Comments
 (0)