]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/unsafe-fn.goml
Rollup merge of #107777 - compiler-errors:derive_const-actually-derive-const, r=fee1...
[rust.git] / tests / rustdoc-gui / unsafe-fn.goml
1 // Check position and color of the `<sup>` for unsafe elements.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3 // If the text isn't displayed, the browser doesn't compute color style correctly...
4 show-text: true
5
6 compare-elements-property: (
7     "//a[@title='fn test_docs::safe_fn']/..",
8     "//a[@title='fn test_docs::unsafe_fn']/..",
9     ["clientHeight"]
10 )
11
12 define-function: (
13     "sup-check",
14     // `theme` is the theme being tested.
15     // `color` is the expected color of the `<sup>` element.
16     (theme, color),
17     block {
18         // Set the theme.
19         local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
20         // We reload the page so the local storage settings are being used.
21         reload:
22         assert-css: (".item-left sup", {"color": |color|})
23     },
24 )
25
26 call-function: ("sup-check", ("dark", "rgb(221, 221, 221)"))
27 call-function: ("sup-check", ("ayu", "rgb(197, 197, 197)"))
28 call-function: ("sup-check", ("light", "rgb(0, 0, 0)"))