about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-07-03 13:26:28 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-07-03 13:26:40 +0200
commit9d130582ab00195d4bc07c1cc7bcbcefd46e779c (patch)
treeb3c6c75430d9ee8639cf3d575e2e5465793d0bc4
parent75cc2b8e8ceadca1672594a7e2056eade5da951d (diff)
downloadrust-9d130582ab00195d4bc07c1cc7bcbcefd46e779c.tar.gz
rust-9d130582ab00195d4bc07c1cc7bcbcefd46e779c.zip
Add GUI test for long inline cfg labels display
-rw-r--r--tests/rustdoc-gui/label-next-to-symbol.goml12
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs9
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml
index 6c6380256bd..eb603d6c6b6 100644
--- a/tests/rustdoc-gui/label-next-to-symbol.goml
+++ b/tests/rustdoc-gui/label-next-to-symbol.goml
@@ -37,7 +37,6 @@ compare-elements-position: (
     ("y"),
 )
 
-
 // Mobile view
 set-window-size: (600, 600)
 // staggered layout with 2em spacing
@@ -64,3 +63,14 @@ compare-elements-position-false: (
     "//*[@class='desc docblock-short'][text()='a thing with a label']",
     ("y"),
 )
+
+// Ensure it doesn't expand.
+set-window-size: (800, 800)
+go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
+// This part of the tags should not be on the same line as the beginning since the width
+// is too small for that.
+compare-elements-position-false: (
+    "//*[@class='stab portability']/code[text()='appservice-api-c']",
+    "//*[@class='stab portability']/code[text()='server']",
+    ("y"),
+)
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index c040fa02dff..ecf3a7cc147 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -507,3 +507,12 @@ pub mod fields {
         },
     }
 }
+
+pub mod cfgs {
+    #[doc(cfg(all(
+        any(not(feature = "appservice-api-c"), not(feature = "appservice-api-s")),
+        any(not(feature = "client"), not(feature = "server")),
+    )))]
+    /// Some docs.
+    pub mod cfgs {}
+}