rustdoc: add test case for associated type margins
This commit is contained in:
parent
791f04e5a4
commit
492ee6ae05
17
src/test/rustdoc-gui/method-margins.goml
Normal file
17
src/test/rustdoc-gui/method-margins.goml
Normal file
@ -0,0 +1,17 @@
|
||||
goto: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait"
|
||||
|
||||
assert-count: ("#trait-implementations-list > .rustdoc-toggle", 1)
|
||||
|
||||
compare-elements-css: (
|
||||
// compare margin on type with margin on method
|
||||
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1) > summary",
|
||||
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2) > summary",
|
||||
["margin"]
|
||||
)
|
||||
|
||||
compare-elements-css: (
|
||||
// compare margin on type with margin on method
|
||||
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1)",
|
||||
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2)",
|
||||
["margin"]
|
||||
)
|
@ -416,3 +416,20 @@ pub trait TraitWithoutGenerics {
|
||||
|
||||
fn foo();
|
||||
}
|
||||
|
||||
pub mod trait_members {
|
||||
pub trait TraitMembers {
|
||||
/// Some type
|
||||
type Type;
|
||||
/// Some function
|
||||
fn function();
|
||||
/// Some other function
|
||||
fn function2();
|
||||
}
|
||||
pub struct HasTrait;
|
||||
impl TraitMembers for HasTrait {
|
||||
type Type = u8;
|
||||
fn function() {}
|
||||
fn function2() {}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user