Skip to content

Commit 15babed

Browse files
add tests for rustdoc output-format json
1 parent 10492c3 commit 15babed

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

src/test/rustdoc-ui/coverage/json.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// build-pass
2+
// compile-flags:-Z unstable-options --show-coverage
3+
4+
pub mod foo {
5+
/// Hello!
6+
pub struct Foo;
7+
/// Bar
8+
pub enum Bar { A }
9+
}
10+
11+
/// X
12+
pub struct X;
13+
14+
/// Bar
15+
pub mod bar {
16+
/// bar
17+
pub struct Bar;
18+
/// X
19+
pub enum X { Y }
20+
}
21+
22+
/// yolo
23+
pub enum Yolo { X }
24+
25+
pub struct Xo<T: Clone> {
26+
x: T,
27+
}
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+-------------------------------------+------------+------------+------------+
2+
| File | Documented | Total | Percentage |
3+
+-------------------------------------+------------+------------+------------+
4+
| ...test/rustdoc-ui/coverage/json.rs | 7 | 13 | 53.8% |
5+
+-------------------------------------+------------+------------+------------+
6+
| Total | 7 | 13 | 53.8% |
7+
+-------------------------------------+------------+------------+------------+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// compile-flags:-Z unstable-options --output-format
2+
// should-fail
3+
4+
/// toudoum!
5+
pub struct SomeStruct;

0 commit comments

Comments
 (0)