Rollup merge of #103486 - GuillaumeGomez:cleanup-rustdoc-gui-highlight-colors, r=notriddle

Use functions in highlight-colors rustdoc GUI test

r? ``@notriddle``
This commit is contained in:
Yuki Okushi 2022-10-25 08:01:30 +09:00 committed by GitHub
commit d77e2394bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,56 +2,93 @@
goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
show-text: true show-text: true
local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"} define-function: (
reload: "check-colors",
(
theme,
kw,
kw2,
prelude_ty,
prelude_val,
lifetime,
number,
string,
bool_val,
self,
attribute,
macro,
question_mark,
comment,
doc_comment,
),
[
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
("reload"),
("assert-css", ("pre.rust .kw", {"color": |kw|}, ALL)),
("assert-css", ("pre.rust .kw-2", {"color": |kw2|}, ALL)),
("assert-css", ("pre.rust .prelude-ty", {"color": |prelude_ty|}, ALL)),
("assert-css", ("pre.rust .prelude-val", {"color": |prelude_val|}, ALL)),
("assert-css", ("pre.rust .lifetime", {"color": |lifetime|}, ALL)),
("assert-css", ("pre.rust .number", {"color": |number|}, ALL)),
("assert-css", ("pre.rust .string", {"color": |string|}, ALL)),
("assert-css", ("pre.rust .bool-val", {"color": |bool_val|}, ALL)),
("assert-css", ("pre.rust .self", {"color": |self|}, ALL)),
("assert-css", ("pre.rust .attribute", {"color": |attribute|}, ALL)),
("assert-css", ("pre.rust .macro", {"color": |macro|}, ALL)),
("assert-css", ("pre.rust .question-mark", {"color": |question_mark|}, ALL)),
("assert-css", ("pre.rust .comment", {"color": |comment|}, ALL)),
("assert-css", ("pre.rust .doccomment", {"color": |doc_comment|}, ALL)),
],
)
assert-css: ("pre.rust .kw", {"color": "rgb(255, 119, 51)"}, ALL) call-function: ("check-colors", {
assert-css: ("pre.rust .kw-2", {"color": "rgb(255, 119, 51)"}, ALL) "theme": "ayu",
assert-css: ("pre.rust .prelude-ty", {"color": "rgb(105, 242, 223)"}, ALL) "kw": "rgb(255, 119, 51)",
assert-css: ("pre.rust .prelude-val", {"color": "rgb(255, 119, 51)"}, ALL) "kw2": "rgb(255, 119, 51)",
assert-css: ("pre.rust .lifetime", {"color": "rgb(255, 119, 51)"}, ALL) "prelude_ty": "rgb(105, 242, 223)",
assert-css: ("pre.rust .number", {"color": "rgb(184, 204, 82)"}, ALL) "prelude_val": "rgb(255, 119, 51)",
assert-css: ("pre.rust .string", {"color": "rgb(184, 204, 82)"}, ALL) "lifetime": "rgb(255, 119, 51)",
assert-css: ("pre.rust .bool-val", {"color": "rgb(255, 119, 51)"}, ALL) "number": "rgb(184, 204, 82)",
assert-css: ("pre.rust .self", {"color": "rgb(54, 163, 217)"}, ALL) "string": "rgb(184, 204, 82)",
assert-css: ("pre.rust .attribute", {"color": "rgb(230, 225, 207)"}, ALL) "bool_val": "rgb(255, 119, 51)",
assert-css: ("pre.rust .macro", {"color": "rgb(163, 122, 204)"}, ALL) "self": "rgb(54, 163, 217)",
assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) "attribute": "rgb(230, 225, 207)",
assert-css: ("pre.rust .comment", {"color": "rgb(120, 135, 151)"}, ALL) "macro": "rgb(163, 122, 204)",
assert-css: ("pre.rust .doccomment", {"color": "rgb(161, 172, 136)"}, ALL) "question_mark": "rgb(255, 144, 17)",
"comment": "rgb(120, 135, 151)",
local-storage: {"rustdoc-theme": "dark"} "doc_comment": "rgb(161, 172, 136)",
reload: })
call-function: ("check-colors", {
assert-css: ("pre.rust .kw", {"color": "rgb(171, 138, 193)"}, ALL) "theme": "dark",
assert-css: ("pre.rust .kw-2", {"color": "rgb(118, 154, 203)"}, ALL) "kw": "rgb(171, 138, 193)",
assert-css: ("pre.rust .prelude-ty", {"color": "rgb(118, 154, 203)"}, ALL) "kw2": "rgb(118, 154, 203)",
assert-css: ("pre.rust .prelude-val", {"color": "rgb(238, 104, 104)"}, ALL) "prelude_ty": "rgb(118, 154, 203)",
assert-css: ("pre.rust .lifetime", {"color": "rgb(217, 127, 38)"}, ALL) "prelude_val": "rgb(238, 104, 104)",
assert-css: ("pre.rust .number", {"color": "rgb(131, 163, 0)"}, ALL) "lifetime": "rgb(217, 127, 38)",
assert-css: ("pre.rust .string", {"color": "rgb(131, 163, 0)"}, ALL) "number": "rgb(131, 163, 0)",
assert-css: ("pre.rust .bool-val", {"color": "rgb(238, 104, 104)"}, ALL) "string": "rgb(131, 163, 0)",
assert-css: ("pre.rust .self", {"color": "rgb(238, 104, 104)"}, ALL) "bool_val": "rgb(238, 104, 104)",
assert-css: ("pre.rust .attribute", {"color": "rgb(238, 104, 104)"}, ALL) "self": "rgb(238, 104, 104)",
assert-css: ("pre.rust .macro", {"color": "rgb(62, 153, 159)"}, ALL) "attribute": "rgb(238, 104, 104)",
assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) "macro": "rgb(62, 153, 159)",
assert-css: ("pre.rust .comment", {"color": "rgb(141, 141, 139)"}, ALL) "question_mark": "rgb(255, 144, 17)",
assert-css: ("pre.rust .doccomment", {"color": "rgb(140, 163, 117)"}, ALL) "comment": "rgb(141, 141, 139)",
"doc_comment": "rgb(140, 163, 117)",
local-storage: {"rustdoc-theme": "light"} })
reload: call-function: ("check-colors", {
"theme": "light",
assert-css: ("pre.rust .kw", {"color": "rgb(137, 89, 168)"}, ALL) "kw": "rgb(137, 89, 168)",
assert-css: ("pre.rust .kw-2", {"color": "rgb(66, 113, 174)"}, ALL) "kw2": "rgb(66, 113, 174)",
assert-css: ("pre.rust .prelude-ty", {"color": "rgb(66, 113, 174)"}, ALL) "prelude_ty": "rgb(66, 113, 174)",
assert-css: ("pre.rust .prelude-val", {"color": "rgb(200, 40, 41)"}, ALL) "prelude_val": "rgb(200, 40, 41)",
assert-css: ("pre.rust .lifetime", {"color": "rgb(183, 101, 20)"}, ALL) "lifetime": "rgb(183, 101, 20)",
assert-css: ("pre.rust .number", {"color": "rgb(113, 140, 0)"}, ALL) "number": "rgb(113, 140, 0)",
assert-css: ("pre.rust .string", {"color": "rgb(113, 140, 0)"}, ALL) "string": "rgb(113, 140, 0)",
assert-css: ("pre.rust .bool-val", {"color": "rgb(200, 40, 41)"}, ALL) "bool_val": "rgb(200, 40, 41)",
assert-css: ("pre.rust .self", {"color": "rgb(200, 40, 41)"}, ALL) "self": "rgb(200, 40, 41)",
assert-css: ("pre.rust .attribute", {"color": "rgb(200, 40, 41)"}, ALL) "attribute": "rgb(200, 40, 41)",
assert-css: ("pre.rust .macro", {"color": "rgb(62, 153, 159)"}, ALL) "macro": "rgb(62, 153, 159)",
assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) "question_mark": "rgb(255, 144, 17)",
assert-css: ("pre.rust .comment", {"color": "rgb(142, 144, 140)"}, ALL) "comment": "rgb(142, 144, 140)",
assert-css: ("pre.rust .doccomment", {"color": "rgb(77, 77, 76)"}, ALL) "doc_comment": "rgb(77, 77, 76)",
})