Skip to content

Commit fbf78e1

Browse files
Add test for enum item tuple fields documentation
1 parent 2b79094 commit fbf78e1

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed
+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 | 75.0% | 0 | 0.0% |
4+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 66.7% | 0 | 0.0% |
55
+-------------------------------------+------------+------------+------------+------------+
6-
| Total | 6 | 75.0% | 0 | 0.0% |
6+
| Total | 6 | 66.7% | 0 | 0.0% |
77
+-------------------------------------+------------+------------+------------+------------+

src/test/rustdoc/toggle-item-contents.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ pub enum EnumStructVariant {
8181
}
8282

8383
// @has 'toggle_item_contents/enum.LargeEnum.html'
84-
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
85-
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 13 variants'
84+
// @count - '//*[@class="rust enum"]//details[@class="rustdoc-toggle type-contents-toggle"]' 1
85+
// @has - '//*[@class="rust enum"]//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 13 variants'
8686
pub enum LargeEnum {
8787
A, B, C, D, E, F(u8), G, H, I, J, K, L, M
8888
}

src/test/rustdoc/tuple-struct-fields-doc.rs

+17
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,20 @@ pub struct Foo(
1717
/// not hello
1818
pub i8,
1919
);
20+
21+
// @has foo/enum.Bar.html
22+
// @has - '//pre[@class="rust enum"]' 'BarVariant(String),'
23+
// @matches - '//*[@id="variant.BarVariant.fields"]/h3' '^Tuple Fields of BarVariant$'
24+
// @has - '//*[@id="variant.BarVariant.field.0"]' '0: String'
25+
// @has - '//*[@id="variant.BarVariant.fields"]//*[@class="docblock"]' 'Hello docs'
26+
// @matches - '//*[@id="variant.FooVariant.fields"]/h3' '^Fields of FooVariant$'
27+
pub enum Bar {
28+
BarVariant(
29+
/// Hello docs
30+
String
31+
),
32+
FooVariant {
33+
/// hello
34+
x: u32,
35+
},
36+
}

0 commit comments

Comments
 (0)