Skip to content

Commit e4d701b

Browse files
Add regression test for stab display in doc blocks
1 parent ee034f4 commit e4d701b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated
2020
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
2121
Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
2222
23-
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
24-
</span>.
25-
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
26-
</span>.
23+
Finally, you can use `quz` only on <span class="stab portability" data-span="1"><code>Unix or x86-64
24+
</code></span>.
25+
Finally, you can use `quz` only on <span class="stab portability" data-span="2"><code>Unix or x86-64
26+
</code></span>.
2727
*/
2828

2929
use std::convert::AsRef;

tests/rustdoc-gui/stab-in-doc.goml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This test ensure that `stab` elements if used in doc blocks are not breaking the text layout.
2+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
3+
// We make the window wide enough for the two stabs who are looking into to be on the same line.
4+
set-window-size: (1100, 600)
5+
compare-elements-position: (
6+
".top-doc .docblock span[data-span='1']",
7+
".top-doc .docblock span[data-span='2']",
8+
["y"],
9+
)

0 commit comments

Comments
 (0)