Skip to content

Commit 0eff07e

Browse files
Add UI regressions tests for rustdoc --show-coverage option
1 parent e9161db commit 0eff07e

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ compile-flags: -Z unstable-options --show-coverage --output-format=json
2+
//@ check-pass
3+
4+
mod bar {
5+
/// a
6+
///
7+
/// ```
8+
/// let x = 0;
9+
/// ```
10+
pub struct Foo;
11+
}
12+
13+
pub use bar::Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":2,"with_examples":1}}

tests/rustdoc-ui/show-coverage.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ compile-flags: -Z unstable-options --show-coverage
2+
//@ check-pass
3+
4+
mod bar {
5+
/// a
6+
///
7+
/// ```
8+
/// let x = 0;
9+
/// ```
10+
pub struct Foo;
11+
}
12+
13+
pub use bar::Foo;

tests/rustdoc-ui/show-coverage.stdout

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+-------------------------------------+------------+------------+------------+------------+
2+
| File | Documented | Percentage | Examples | Percentage |
3+
+-------------------------------------+------------+------------+------------+------------+
4+
| ...ests/rustdoc-ui/show-coverage.rs | 1 | 50.0% | 1 | 50.0% |
5+
+-------------------------------------+------------+------------+------------+------------+
6+
| Total | 1 | 50.0% | 1 | 50.0% |
7+
+-------------------------------------+------------+------------+------------+------------+

0 commit comments

Comments
 (0)