diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-03-22 22:17:43 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-03-22 22:35:19 +0100 |
| commit | 6c80deb4a5b8e9ec6dcf03e504461ec71eab69f1 (patch) | |
| tree | a032f18b2e1cc4d89dfd67dfee02d47332d7056b | |
| parent | 494e29deeaa9759b71df8183c00abb72a12575d8 (diff) | |
| download | rust-6c80deb4a5b8e9ec6dcf03e504461ec71eab69f1.tar.gz rust-6c80deb4a5b8e9ec6dcf03e504461ec71eab69f1.zip | |
Add GUI test to enforce tooltip position
| -rw-r--r-- | src/test/rustdoc-gui/check_info_sign_position.goml | 9 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/lib.rs | 18 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml new file mode 100644 index 00000000000..9aa72a3ad53 --- /dev/null +++ b/src/test/rustdoc-gui/check_info_sign_position.goml @@ -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" }) diff --git a/src/test/rustdoc-gui/lib.rs b/src/test/rustdoc-gui/lib.rs index 15d8dcc6e84..4c3007e49d9 100644 --- a/src/test/rustdoc-gui/lib.rs +++ b/src/test/rustdoc-gui/lib.rs @@ -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() {} |
