about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-09-02 12:15:06 -0700
committerMichael Howell <michael@notriddle.com>2022-09-02 13:13:22 -0700
commit0f29824760eefd74aba742fc2c287c2d3901bd63 (patch)
tree7df0c35630dabdb264175c091cc865c4dd85bb6c /src/test
parent6f95c89c4d65a5579295e6490c4fa70e08424fcb (diff)
downloadrust-0f29824760eefd74aba742fc2c287c2d3901bd63.tar.gz
rust-0f29824760eefd74aba742fc2c287c2d3901bd63.zip
rustdoc: put in rule to get alignment in desktop and mobile layouts
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/item-info-alignment.goml10
-rw-r--r--src/test/rustdoc-gui/src/lib2/lib.rs10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/item-info-alignment.goml b/src/test/rustdoc-gui/item-info-alignment.goml
new file mode 100644
index 00000000000..4d7b5045f7c
--- /dev/null
+++ b/src/test/rustdoc-gui/item-info-alignment.goml
@@ -0,0 +1,10 @@
+// This test ensures that the "item-info" looks about the same
+// whether or not it's inside a toggle.
+goto: file://|DOC_PATH|/lib2/struct.ItemInfoAlignmentTest.html
+
+// First, we try it in "desktop" mode.
+size: (1200, 870)
+compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
+// Next, we try it in "mobile" mode (max-width: 700px).
+size: (650, 650)
+compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
diff --git a/src/test/rustdoc-gui/src/lib2/lib.rs b/src/test/rustdoc-gui/src/lib2/lib.rs
index 7f3172878bf..5a151ed7b68 100644
--- a/src/test/rustdoc-gui/src/lib2/lib.rs
+++ b/src/test/rustdoc-gui/src/lib2/lib.rs
@@ -170,3 +170,13 @@ where
     type Output;
     fn index(&self, index: Idx) -> &Self::Output;
 }
+
+pub struct ItemInfoAlignmentTest;
+
+impl ItemInfoAlignmentTest {
+    /// This method has docs
+    #[deprecated]
+    pub fn foo() {}
+    #[deprecated]
+    pub fn bar() {}
+}