about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/rustdoc-gui/no-docblock.goml8
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs12
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/no-docblock.goml b/src/test/rustdoc-gui/no-docblock.goml
new file mode 100644
index 00000000000..2408be4534b
--- /dev/null
+++ b/src/test/rustdoc-gui/no-docblock.goml
@@ -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})
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index 1c066206c1f..0281973c1ba 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -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) {}
+}