Add test for enum tuple variants and tuple struct doc count

This commit is contained in:
Guillaume Gomez 2021-09-06 16:27:09 +02:00
parent 64344cce14
commit eda4cfb132
5 changed files with 71 additions and 2 deletions

View 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,
);

View file

@ -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% |
+-------------------------------------+------------+------------+------------+------------+

View 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);

View 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% |
+-------------------------------------+------------+------------+------------+------------+

View file

@ -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% |
+-------------------------------------+------------+------------+------------+------------+