Skip to content

Commit 6069f71

Browse files
Add GUI test for .stab elements in docblocks
1 parent 150623e commit 6069f71

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This test checks that using `.stab` attributes in `.docblock` elements doesn't
2+
// create scrollable paragraphs.
3+
goto: file://|DOC_PATH|/test_docs/index.html
4+
// Needs the text to be display to check for scrollable content.
5+
show-text: true
6+
size: (786, 600)
7+
// Confirms that there 3 paragraphs.
8+
assert-count: (".top-doc .docblock p", 3)
9+
// Checking that there is no scrollable content.
10+
assert-property: (
11+
".top-doc .docblock p:nth-of-type(1)",
12+
{"scrollHeight": "120", "clientHeight": "120", "scrollWidth": "502", "clientWidth": "502"},
13+
)
14+
assert-property: (
15+
".top-doc .docblock p:nth-of-type(2)",
16+
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
17+
)
18+
assert-property: (
19+
".top-doc .docblock p:nth-of-type(3)",
20+
{"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
21+
)

src/test/rustdoc-gui/src/test_docs/lib.rs

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
#![feature(rustdoc_internals)]
77
#![feature(doc_cfg)]
88

9+
/*!
10+
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
11+
this crate even more!
12+
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
13+
this crate even more!
14+
Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
15+
this crate even more!
16+
17+
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
18+
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
19+
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
20+
21+
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
22+
</span>.
23+
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
24+
</span>.
25+
*/
26+
927
use std::convert::AsRef;
1028
use std::fmt;
1129

0 commit comments

Comments
 (0)