Skip to content

Commit 3f123c2

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

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ 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>
23+
Finally, you can use `quz` only on <span class="stab portability" data-span="1"><code>Unix or x86-64</code>
2424
</span>.
25-
Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
25+
Finally, you can use `quz` only on <span class="stab portability" data-span="2"><code>Unix or x86-64</code>
2626
</span>.
2727
*/
2828

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)