mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
Add test for enum tuple variants and tuple struct doc count
This commit is contained in:
@@ -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% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
@@ -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);
|
||||
@@ -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% |
|
||||
+-------------------------------------+------------+------------+------------+------------+
|
||||
|
||||
Reference in New Issue
Block a user