Skip to content

Commit

Permalink
Add GUI test to enforce tooltip position
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 22, 2021
1 parent 494e29d commit 6c80deb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/test/rustdoc-gui/check_info_sign_position.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
goto: file://|DOC_PATH|/index.html
goto: ./fn.check_list_code_block.html
// If the codeblock is the first element of the docblock, the information tooltip must have
// have some top margin to avoid going over the toggle (the "[+]").
assert: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
// Checks that the other codeblocks don't have this top margin.
assert: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
assert: ("ol > li > .information > .ignore", { "margin-top": "0px" })
assert: (".docblock > .information > .ignore", { "margin-top": "0px" })
18 changes: 14 additions & 4 deletions src/test/rustdoc-gui/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,26 @@ pub trait AnotherOne {
fn func3();
}

/// ```compile_fail
/// whatever
/// ```
///
/// Check for "i" signs in lists!
///
/// 1. elem 1
/// 2.test 1
/// ```compile_fail
/// fn foo() {}
/// ```
/// 2. test 1
/// ```compile_fail
/// fn foo() {}
/// ```
/// 3. elem 3
/// 4. ```ignore (it's a test)
/// fn foo() {}
/// ```
/// 5. elem 5
///
/// Final one:
///
/// ```ignore (still a test)
/// let x = 12;
/// ```
pub fn check_list_code_block() {}

0 comments on commit 6c80deb

Please sign in to comment.