Skip to content

Commit eda4cfb

Browse files
Add test for enum tuple variants and tuple struct doc count
1 parent 64344cc commit eda4cfb

File tree

5 files changed

+71
-2
lines changed

5 files changed

+71
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// compile-flags:-Z unstable-options --show-coverage
2+
// check-pass
3+
4+
// The point of this test is to ensure that the number of "documented" items
5+
// is higher than in `enum-tuple.rs`.
6+
7+
//! (remember the crate root is still a module)
8+
9+
/// so check out this enum here
10+
pub enum ThisEnum {
11+
/// VarOne.
12+
VarOne(
13+
/// hello!
14+
String,
15+
),
16+
/// Var Two.
17+
VarTwo(
18+
/// Hello
19+
String,
20+
/// Bis repetita.
21+
String,
22+
),
23+
}
24+
25+
/// Struct.
26+
pub struct ThisStruct(
27+
/// hello
28+
u32,
29+
);
30+
31+
/// Struct.
32+
pub struct ThisStruct2(
33+
/// hello
34+
u32,
35+
/// Bis repetita.
36+
u8,
37+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+-------------------------------------+------------+------------+------------+------------+
2+
| File | Documented | Percentage | Examples | Percentage |
3+
+-------------------------------------+------------+------------+------------+------------+
4+
| ...overage/enum-tuple-documented.rs | 9 | 100.0% | 0 | 0.0% |
5+
+-------------------------------------+------------+------------+------------+------------+
6+
| Total | 9 | 100.0% | 0 | 0.0% |
7+
+-------------------------------------+------------+------------+------------+------------+
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// compile-flags:-Z unstable-options --show-coverage
2+
// check-pass
3+
4+
//! (remember the crate root is still a module)
5+
6+
/// so check out this enum here
7+
pub enum ThisEnum {
8+
/// No need to document the field if there is only one in a tuple variant!
9+
VarOne(String),
10+
/// But if there is more than one... still fine!
11+
VarTwo(String, String),
12+
}
13+
14+
/// Struct.
15+
pub struct ThisStruct(u32);
16+
17+
/// Struct.
18+
pub struct ThisStruct2(u32, u8);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+-------------------------------------+------------+------------+------------+------------+
2+
| File | Documented | Percentage | Examples | Percentage |
3+
+-------------------------------------+------------+------------+------------+------------+
4+
| ...ustdoc-ui/coverage/enum-tuple.rs | 6 | 100.0% | 0 | 0.0% |
5+
+-------------------------------------+------------+------------+------------+------------+
6+
| Total | 6 | 100.0% | 0 | 0.0% |
7+
+-------------------------------------+------------+------------+------------+------------+
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+-------------------------------------+------------+------------+------------+------------+
22
| File | Documented | Percentage | Examples | Percentage |
33
+-------------------------------------+------------+------------+------------+------------+
4-
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 66.7% | 0 | 0.0% |
4+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 75.0% | 0 | 0.0% |
55
+-------------------------------------+------------+------------+------------+------------+
6-
| Total | 6 | 66.7% | 0 | 0.0% |
6+
| Total | 6 | 75.0% | 0 | 0.0% |
77
+-------------------------------------+------------+------------+------------+------------+

0 commit comments

Comments
 (0)