Add test for enum tuple variants and tuple struct doc count
This commit is contained in:
parent
64344cce14
commit
eda4cfb132
5 changed files with 71 additions and 2 deletions
37
src/test/rustdoc-ui/coverage/enum-tuple-documented.rs
Normal file
37
src/test/rustdoc-ui/coverage/enum-tuple-documented.rs
Normal file
|
@ -0,0 +1,37 @@
|
|||
// compile-flags:-Z unstable-options --show-coverage
|
||||
// check-pass
|
||||
|
||||
// The point of this test is to ensure that the number of "documented" items
|
||||
// is higher than in `enum-tuple.rs`.
|
||||
|
||||
//! (remember the crate root is still a module)
|
||||
|
||||
/// so check out this enum here
|
||||
pub enum ThisEnum {
|
||||
/// VarOne.
|
||||
VarOne(
|
||||
/// hello!
|
||||
String,
|
||||
),
|
||||
/// Var Two.
|
||||
VarTwo(
|
||||
/// Hello
|
||||
String,
|
||||
/// Bis repetita.
|
||||
String,
|
||||
),
|
||||
}
|
||||
|
||||
/// Struct.
|
||||
pub struct ThisStruct(
|
||||
/// hello
|
||||
u32,
|
||||
);
|
||||
|
||||
/// Struct.
|
||||
pub struct ThisStruct2(
|
||||
/// hello
|
||||
u32,
|
||||
/// Bis repetita.
|
||||
u8,
|
||||
);
|
|
@ -0,0 +1,7 @@
|
|||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| File | Documented | Percentage | Examples | Percentage |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| ...overage/enum-tuple-documented.rs | 9 | 100.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| Total | 9 | 100.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
18
src/test/rustdoc-ui/coverage/enum-tuple.rs
Normal file
18
src/test/rustdoc-ui/coverage/enum-tuple.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// compile-flags:-Z unstable-options --show-coverage
|
||||
// check-pass
|
||||
|
||||
//! (remember the crate root is still a module)
|
||||
|
||||
/// so check out this enum here
|
||||
pub enum ThisEnum {
|
||||
/// No need to document the field if there is only one in a tuple variant!
|
||||
VarOne(String),
|
||||
/// But if there is more than one... still fine!
|
||||
VarTwo(String, String),
|
||||
}
|
||||
|
||||
/// Struct.
|
||||
pub struct ThisStruct(u32);
|
||||
|
||||
/// Struct.
|
||||
pub struct ThisStruct2(u32, u8);
|
7
src/test/rustdoc-ui/coverage/enum-tuple.stdout
Normal file
7
src/test/rustdoc-ui/coverage/enum-tuple.stdout
Normal file
|
@ -0,0 +1,7 @@
|
|||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| File | Documented | Percentage | Examples | Percentage |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| ...ustdoc-ui/coverage/enum-tuple.rs | 6 | 100.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| Total | 6 | 100.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
|
@ -1,7 +1,7 @@
|
|||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| File | Documented | Percentage | Examples | Percentage |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 66.7% | 0 | 0.0% |
|
||||
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 75.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
| Total | 6 | 66.7% | 0 | 0.0% |
|
||||
| Total | 6 | 75.0% | 0 | 0.0% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
|
|
Loading…
Reference in a new issue