Skip to content

Commit 6c80deb

Browse files
Add GUI test to enforce tooltip position
1 parent 494e29d commit 6c80deb

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
goto: file://|DOC_PATH|/index.html
2+
goto: ./fn.check_list_code_block.html
3+
// If the codeblock is the first element of the docblock, the information tooltip must have
4+
// have some top margin to avoid going over the toggle (the "[+]").
5+
assert: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
6+
// Checks that the other codeblocks don't have this top margin.
7+
assert: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
8+
assert: ("ol > li > .information > .ignore", { "margin-top": "0px" })
9+
assert: (".docblock > .information > .ignore", { "margin-top": "0px" })

src/test/rustdoc-gui/lib.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,26 @@ pub trait AnotherOne {
5757
fn func3();
5858
}
5959

60+
/// ```compile_fail
61+
/// whatever
62+
/// ```
63+
///
6064
/// Check for "i" signs in lists!
6165
///
6266
/// 1. elem 1
63-
/// 2.test 1
64-
/// ```compile_fail
65-
/// fn foo() {}
66-
/// ```
67+
/// 2. test 1
68+
/// ```compile_fail
69+
/// fn foo() {}
70+
/// ```
6771
/// 3. elem 3
6872
/// 4. ```ignore (it's a test)
6973
/// fn foo() {}
7074
/// ```
7175
/// 5. elem 5
76+
///
77+
/// Final one:
78+
///
79+
/// ```ignore (still a test)
80+
/// let x = 12;
81+
/// ```
7282
pub fn check_list_code_block() {}

0 commit comments

Comments
 (0)