rustdoc: add gui test for no-docblock margins

This commit is contained in:
Michael Howell 2022-09-30 10:44:15 -07:00
parent f145f283f7
commit 1dcbe72031
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// This test checks that there are margins applied to methods with no docblocks.
goto: file://|DOC_PATH|/test_docs/trait.TraitWithNoDocblocks.html
// Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24})
goto: file://|DOC_PATH|/test_docs/struct.TypeWithNoDocblocks.html
// Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='method.first_fn']", "//*[@id='method.second_fn']", {"y": 24})

View File

@ -355,3 +355,15 @@ impl<R: std::io::Read> std::iter::Iterator for NotableStructWithLongName<R> {
fn next(&mut self) -> Option<Self::Item> { () }
}
pub trait TraitWithNoDocblocks {
fn first_fn(&self);
fn second_fn(&self);
}
pub struct TypeWithNoDocblocks;
impl TypeWithNoDocblocks {
pub fn first_fn(&self) {}
pub fn second_fn(&self) {}
}