Skip to content

Commit 1dcbe72

Browse files
committed
rustdoc: add gui test for no-docblock margins
1 parent f145f28 commit 1dcbe72

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/test/rustdoc-gui/no-docblock.goml

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

src/test/rustdoc-gui/src/test_docs/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,15 @@ impl<R: std::io::Read> std::iter::Iterator for NotableStructWithLongName<R> {
355355

356356
fn next(&mut self) -> Option<Self::Item> { () }
357357
}
358+
359+
pub trait TraitWithNoDocblocks {
360+
fn first_fn(&self);
361+
fn second_fn(&self);
362+
}
363+
364+
pub struct TypeWithNoDocblocks;
365+
366+
impl TypeWithNoDocblocks {
367+
pub fn first_fn(&self) {}
368+
pub fn second_fn(&self) {}
369+
}

0 commit comments

Comments
 (0)