Skip to content

Commit 29777fc

Browse files
Update tests
1 parent 5bd9146 commit 29777fc

File tree

5 files changed

+42
-30
lines changed

5 files changed

+42
-30
lines changed

src/test/rustdoc/assoc-consts.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ impl Qux for Bar {
8888
/// Docs for QUX1 in impl.
8989
const QUX1: i8 = 5;
9090
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
91-
// @has - '//*[@class="docblock hidden"]' "Docs for QUX_DEFAULT12 in trait."
91+
// @!has - '//div[@class="impl-items"]/details[@open=""]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
92+
// @has - '//div[@class="impl-items"]/details//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
9293
const QUX_DEFAULT0: u16 = 6;
9394
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
9495
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl."
9596
/// Docs for QUX_DEFAULT1 in impl.
9697
const QUX_DEFAULT1: i16 = 7;
9798
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
98-
// @has - '//*[@class="docblock hidden"]' "Docs for QUX_DEFAULT2 in trait."
99+
// @!has - '//div[@class="impl-items"]/details[@open=""]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
100+
// @has - '//div[@class="impl-items"]/details//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
99101
}

src/test/rustdoc/inline_cross/assoc-items.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ extern crate assoc_items;
1616
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
1717
// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault'
1818
// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
19-
// @has - '//*[@class="docblock hidden"]' 'docs for ConstWithDefault'
19+
// @!has - '//details[@open=""]/details/div[@class="docblock"]' 'docs for ConstWithDefault'
20+
// @has - '//details/details/div[@class="docblock"]' 'docs for ConstWithDefault'
2021
// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32'
2122
// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault'
2223
// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
23-
// @has - '//*[@class="docblock hidden"]' 'docs for TypeWithDefault'
24+
// @!has - '//details[@open=""]/details/div[@class="docblock"]' 'docs for TypeWithDefault'
25+
// @has - '//details/details/div[@class="docblock"]' 'docs for TypeWithDefault'
2426
// @has - '//*[@id="method.method_no_default"]' 'fn method_no_default()'
2527
// @has - '//*[@class="docblock"]' 'dox for method_no_default'
2628
// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()'
27-
// @has - '//*[@class="docblock hidden"]' 'docs for method_with_default'
29+
// @!has - '//details[@open=""]/details/div[@class="docblock"]' 'docs for method_with_default'
30+
// @has - '//details/details/div[@class="docblock"]' 'docs for method_with_default'
2831
pub use assoc_items::MyStruct;
2932

3033
// @has foo/trait.MyTrait.html

src/test/rustdoc/inline_cross/impl-inline-without-trait.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ extern crate impl_inline_without_trait;
88

99
// @has 'foo/struct.MyStruct.html'
1010
// @has - '//*[@id="method.my_trait_method"]' 'fn my_trait_method()'
11-
// @has - '//*[@class="docblock hidden"]' 'docs for my_trait_method'
11+
// @!has - '//details[@open=""]/details/div[@class="docblock"]' 'docs for my_trait_method'
12+
// @has - '//details/details/div[@class="docblock"]' 'docs for my_trait_method'
1213
pub use impl_inline_without_trait::MyStruct;

src/test/rustdoc/manual_impl.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ pub trait T {
2424
// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.'
2525
// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.'
2626
// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
27-
// @has - '//*[@class="docblock hidden"]' 'Docs associated with the trait b_method definition.'
28-
// @has - '//*[@class="docblock hidden"]' 'Docs associated with the trait c_method definition.'
27+
// @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
28+
// @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
29+
// @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
30+
// @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
2931
// @!has - '//*[@class="docblock"]' 'There is another line'
30-
// @has - '//*[@class="docblock hidden"]' 'Read more'
32+
// @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Read more'
33+
// @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Read more'
3134
pub struct S1(usize);
3235

3336
/// Docs associated with the S1 trait implementation.
@@ -42,9 +45,10 @@ impl T for S1 {
4245
// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.'
4346
// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.'
4447
// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.'
45-
// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
46-
// @!has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.'
47-
// @has - '//*[@class="docblock hidden"]' 'Docs associated with the trait b_method definition.'
48+
// @!has - '//details[open=""]/div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
49+
// @!has - '//details[open=""]/div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
50+
// @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
51+
// @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
4852
pub struct S2(usize);
4953

5054
/// Docs associated with the S2 trait implementation.
@@ -61,9 +65,10 @@ impl T for S2 {
6165
}
6266

6367
// @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T'
64-
// @has - '//*[@class="docblock"]' 'Docs associated with the S3 trait implementation.'
65-
// @has - '//*[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.'
66-
// @has - '//*[@class="docblock hidden"]' 'Docs associated with the trait a_method definition.'
68+
// @has - '//details[@open=""]/div[@class="docblock"]' 'Docs associated with the S3 trait implementation.'
69+
// @has - '//details[@open=""]/div[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.'
70+
// @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
71+
// @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
6772
pub struct S3(usize);
6873

6974
/// Docs associated with the S3 trait implementation.

src/test/rustdoc/trait-impl.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,27 @@ pub trait Trait {
2121
pub struct Struct;
2222

2323
impl Trait for Struct {
24-
// @has trait_impl/struct.Struct.html '//*[@id="method.a"]/../div/p' 'Some long docs'
25-
// @!has - '//*[@id="method.a"]/../div/p' 'link will be added'
26-
// @has - '//*[@id="method.a"]/../div/p/a' 'Read more'
27-
// @has - '//*[@id="method.a"]/../div/p/a/@href' 'trait.Trait.html'
24+
// @has trait_impl/struct.Struct.html '//*[@id="method.a"]/../../div[@class="docblock"]/p' 'Some long docs'
25+
// @!has - '//*[@id="method.a"]/../../div[@class="docblock"]/p' 'link will be added'
26+
// @has - '//*[@id="method.a"]/../../div[@class="docblock"]/p/a' 'Read more'
27+
// @has - '//*[@id="method.a"]/../../div[@class="docblock"]/p/a/@href' 'trait.Trait.html#tymethod.a'
2828
fn a() {}
2929

30-
// @has trait_impl/struct.Struct.html '//*[@id="method.b"]/../div/p' 'These docs contain'
31-
// @has - '//*[@id="method.b"]/../div/p/a' 'reference link'
32-
// @has - '//*[@id="method.b"]/../div/p/a/@href' 'https://example.com'
33-
// @has - '//*[@id="method.b"]/../div/p/a' 'Read more'
34-
// @has - '//*[@id="method.b"]/../div/p/a/@href' 'trait.Trait.html'
30+
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p' 'These docs contain'
31+
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a' 'reference link'
32+
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a/@href' 'https://example.com'
33+
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a' 'Read more'
34+
// @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a/@href' 'trait.Trait.html#tymethod.b'
3535
fn b() {}
3636

37-
// @!has trait_impl/struct.Struct.html '//*[@id="method.c"]/../div/p' 'code block'
38-
// @has - '//*[@id="method.c"]/../div/p/a' 'Read more'
39-
// @has - '//*[@id="method.c"]/../div/p/a/@href' 'trait.Trait.html'
37+
// @!has - '//*[@id="method.c"]/../../div[@class="docblock"]/p' 'code block'
38+
// @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a' 'Read more'
39+
// @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.c'
4040
fn c() {}
4141

42-
// @has trait_impl/struct.Struct.html '//*[@id="method.d"]/../div/p' \
43-
// 'Escaped formatting a*b*c* works'
44-
// @!has trait_impl/struct.Struct.html '//*[@id="method.d"]/../div/p/em'
42+
// @has - '//*[@id="method.d"]/../../div[@class="docblock"]/p' 'Escaped formatting a*b*c* works'
43+
// @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/p/em'
4544
fn d() {}
45+
46+
// @has - '//*[@id="impl-Trait"]/code/a/@href' 'trait.Trait.html'
4647
}

0 commit comments

Comments
 (0)