2022-10-04 10:48:23 -05:00
|
|
|
// This test checks the highlight colors in the source code pages.
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
|
2022-10-04 10:48:23 -05:00
|
|
|
show-text: true
|
|
|
|
|
2022-10-24 10:44:17 -05:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
|
|
|
(
|
|
|
|
theme,
|
|
|
|
kw,
|
|
|
|
kw2,
|
|
|
|
prelude_ty,
|
|
|
|
prelude_val,
|
|
|
|
lifetime,
|
|
|
|
number,
|
|
|
|
string,
|
|
|
|
bool_val,
|
|
|
|
self,
|
2022-10-31 15:12:51 -05:00
|
|
|
attr,
|
2022-10-24 10:44:17 -05:00
|
|
|
macro,
|
|
|
|
question_mark,
|
|
|
|
comment,
|
|
|
|
doc_comment,
|
|
|
|
),
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2023-04-11 12:11:34 -05:00
|
|
|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
2023-01-06 08:18:51 -06:00
|
|
|
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 .attr", {"color": |attr|}, 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)
|
|
|
|
},
|
2022-10-24 10:44:17 -05:00
|
|
|
)
|
2022-10-04 10:48:23 -05:00
|
|
|
|
2022-10-24 10:44:17 -05:00
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "ayu",
|
|
|
|
"kw": "rgb(255, 119, 51)",
|
|
|
|
"kw2": "rgb(255, 119, 51)",
|
|
|
|
"prelude_ty": "rgb(105, 242, 223)",
|
|
|
|
"prelude_val": "rgb(255, 119, 51)",
|
|
|
|
"lifetime": "rgb(255, 119, 51)",
|
|
|
|
"number": "rgb(184, 204, 82)",
|
|
|
|
"string": "rgb(184, 204, 82)",
|
|
|
|
"bool_val": "rgb(255, 119, 51)",
|
|
|
|
"self": "rgb(54, 163, 217)",
|
2022-10-31 15:12:51 -05:00
|
|
|
"attr": "rgb(230, 225, 207)",
|
2022-10-24 10:44:17 -05:00
|
|
|
"macro": "rgb(163, 122, 204)",
|
|
|
|
"question_mark": "rgb(255, 144, 17)",
|
|
|
|
"comment": "rgb(120, 135, 151)",
|
|
|
|
"doc_comment": "rgb(161, 172, 136)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "dark",
|
|
|
|
"kw": "rgb(171, 138, 193)",
|
|
|
|
"kw2": "rgb(118, 154, 203)",
|
|
|
|
"prelude_ty": "rgb(118, 154, 203)",
|
|
|
|
"prelude_val": "rgb(238, 104, 104)",
|
|
|
|
"lifetime": "rgb(217, 127, 38)",
|
|
|
|
"number": "rgb(131, 163, 0)",
|
|
|
|
"string": "rgb(131, 163, 0)",
|
|
|
|
"bool_val": "rgb(238, 104, 104)",
|
|
|
|
"self": "rgb(238, 104, 104)",
|
2022-10-31 15:12:51 -05:00
|
|
|
"attr": "rgb(238, 104, 104)",
|
2022-10-24 10:44:17 -05:00
|
|
|
"macro": "rgb(62, 153, 159)",
|
|
|
|
"question_mark": "rgb(255, 144, 17)",
|
|
|
|
"comment": "rgb(141, 141, 139)",
|
|
|
|
"doc_comment": "rgb(140, 163, 117)",
|
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "light",
|
|
|
|
"kw": "rgb(137, 89, 168)",
|
|
|
|
"kw2": "rgb(66, 113, 174)",
|
|
|
|
"prelude_ty": "rgb(66, 113, 174)",
|
|
|
|
"prelude_val": "rgb(200, 40, 41)",
|
|
|
|
"lifetime": "rgb(183, 101, 20)",
|
|
|
|
"number": "rgb(113, 140, 0)",
|
|
|
|
"string": "rgb(113, 140, 0)",
|
|
|
|
"bool_val": "rgb(200, 40, 41)",
|
|
|
|
"self": "rgb(200, 40, 41)",
|
2022-10-31 15:12:51 -05:00
|
|
|
"attr": "rgb(200, 40, 41)",
|
2022-10-24 10:44:17 -05:00
|
|
|
"macro": "rgb(62, 153, 159)",
|
|
|
|
"question_mark": "rgb(255, 144, 17)",
|
|
|
|
"comment": "rgb(142, 144, 140)",
|
|
|
|
"doc_comment": "rgb(77, 77, 76)",
|
|
|
|
})
|