From ae66380da0d219da669e94b7e591d6853191dd0e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 26 Oct 2024 15:45:17 +0200 Subject: [PATCH] Add GUI regression test for code in doc blocks --- tests/rustdoc-gui/check-stab-in-docblock.goml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/rustdoc-gui/check-stab-in-docblock.goml b/tests/rustdoc-gui/check-stab-in-docblock.goml index f25c88690e5..916bea6b069 100644 --- a/tests/rustdoc-gui/check-stab-in-docblock.goml +++ b/tests/rustdoc-gui/check-stab-in-docblock.goml @@ -1,5 +1,5 @@ // This test checks that using `.stab` attributes in `.docblock` elements doesn't -// create scrollable paragraphs. +// create scrollable paragraphs and is correctly displayed (not making weird blocks). go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" // Needs the text to be display to check for scrollable content. show-text: true @@ -31,3 +31,15 @@ assert-property: ( ".top-doc .docblock p:nth-of-type(3)", {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|}, ) + +// Ensure that `` elements in code don't make big blocks. +compare-elements-size-near: ( + "#reexport\.TheStdReexport > code", + ".docblock p span[data-span='1']", + {"height": 1}, +) +compare-elements-size-near: ( + "#reexport\.TheStdReexport > code", + ".docblock p span[data-span='2']", + {"height": 1}, +)