From e4d701b1d3f1cc04574c9b92abfa33e2a4c0e9c3 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 20 Jul 2024 22:28:27 +0200 Subject: [PATCH] Add regression test for stab display in doc blocks --- tests/rustdoc-gui/src/test_docs/lib.rs | 8 ++++---- tests/rustdoc-gui/stab-in-doc.goml | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 tests/rustdoc-gui/stab-in-doc.goml diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs index 7e34178e56f..360ad3edefa 100644 --- a/tests/rustdoc-gui/src/test_docs/lib.rs +++ b/tests/rustdoc-gui/src/test_docs/lib.rs @@ -20,10 +20,10 @@ Also, stop using `bar` as it's deprecated. Also, stop using `bar` as it's deprecated. -Finally, you can use `quz` only on Unix or x86-64 -. -Finally, you can use `quz` only on Unix or x86-64 -. +Finally, you can use `quz` only on Unix or x86-64 +. +Finally, you can use `quz` only on Unix or x86-64 +. */ use std::convert::AsRef; diff --git a/tests/rustdoc-gui/stab-in-doc.goml b/tests/rustdoc-gui/stab-in-doc.goml new file mode 100644 index 00000000000..6a03a51fe9f --- /dev/null +++ b/tests/rustdoc-gui/stab-in-doc.goml @@ -0,0 +1,9 @@ +// This test ensure that `stab` elements if used in doc blocks are not breaking the text layout. +go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" +// We make the window wide enough for the two stabs who are looking into to be on the same line. +set-window-size: (1100, 600) +compare-elements-position: ( + ".top-doc .docblock span[data-span='1']", + ".top-doc .docblock span[data-span='2']", + ["y"], +)