about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-14 10:58:48 +0100
committerGitHub <noreply@github.com>2022-12-14 10:58:48 +0100
commita4f70fff200a6b3df39dc3739929f0301fe4794b (patch)
tree3f3051a98c51613ed3647d13cfa2404ade52345a /src/test
parent00852d12db95380ed5026850c6fe0c663a5ee121 (diff)
parente38d1e909a43767fd5330802acf33b92e3bbdbb3 (diff)
downloadrust-a4f70fff200a6b3df39dc3739929f0301fe4794b.tar.gz
rust-a4f70fff200a6b3df39dc3739929f0301fe4794b.zip
Rollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomez
rustdoc: apply `pre-wrap` CSS to code-wrapped links

This is common syntax used for intra-doc links, so fixing it should help with doc formatting.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/docblock-big-code-mobile.goml4
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/docblock-big-code-mobile.goml b/src/test/rustdoc-gui/docblock-big-code-mobile.goml
index 9f8df44d762..3ce921c2c91 100644
--- a/src/test/rustdoc-gui/docblock-big-code-mobile.goml
+++ b/src/test/rustdoc-gui/docblock-big-code-mobile.goml
@@ -7,3 +7,7 @@ show-text: true // We need to enable text draw to be able to have the "real" siz
 // Little explanations for this test: if the text wasn't displayed on two lines, it would take
 // around 20px (which is the font size).
 assert-property: (".docblock p > code", {"offsetHeight": "44"})
+
+// Same check, but where the long code block is also a link
+goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
+assert-property: (".docblock p > a > code", {"offsetHeight": "44"})
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index d6eeab803df..f55b9ec3af5 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -154,6 +154,11 @@ pub mod huge_amount_of_consts {
 /// Very long code text `hereIgoWithLongTextBecauseWhyNotAndWhyWouldntI`.
 pub mod long_code_block {}
 
+/// Very long code text [`hereIgoWithLongTextBecauseWhyNotAndWhyWouldntI`][lnk].
+///
+/// [lnk]: crate::long_code_block_link
+pub mod long_code_block_link {}
+
 #[macro_export]
 macro_rules! repro {
     () => {};