Skip to content

Commit

Permalink
Add GUI test for .stab elements in docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 21, 2022
1 parent 150623e commit 6069f71
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/rustdoc-gui/check-stab-in-docblock.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This test checks that using `.stab` attributes in `.docblock` elements doesn't
// create scrollable paragraphs.
goto: file://|DOC_PATH|/test_docs/index.html
// Needs the text to be display to check for scrollable content.
show-text: true
size: (786, 600)
// Confirms that there 3 paragraphs.
assert-count: (".top-doc .docblock p", 3)
// Checking that there is no scrollable content.
assert-property: (
".top-doc .docblock p:nth-of-type(1)",
{"scrollHeight": "120", "clientHeight": "120", "scrollWidth": "502", "clientWidth": "502"},
)
assert-property: (
".top-doc .docblock p:nth-of-type(2)",
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
)
assert-property: (
".top-doc .docblock p:nth-of-type(3)",
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
)
18 changes: 18 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
#![feature(rustdoc_internals)]
#![feature(doc_cfg)]

/*!
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
this crate even more!
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
this crate even more!
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
this crate even more!
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
</span>.
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
</span>.
*/

use std::convert::AsRef;
use std::fmt;

Expand Down

0 comments on commit 6069f71

Please sign in to comment.