2022-10-19 15:15:11 +00:00
|
|
|
// This test ensures that the color of the items in the type decl are working as expected.
|
2022-11-09 16:00:05 +00:00
|
|
|
|
2023-10-06 01:44:40 +00:00
|
|
|
// We need to disable this check because `trait.impl/test_docs/trait.TraitWithoutGenerics.js`
|
2022-11-09 16:00:05 +00:00
|
|
|
// doesn't exist.
|
|
|
|
fail-on-request-error: false
|
|
|
|
|
2022-10-19 15:15:11 +00:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
|
|
|
(
|
|
|
|
theme,
|
|
|
|
attr_color,
|
|
|
|
trait_color,
|
|
|
|
struct_color,
|
|
|
|
enum_color,
|
|
|
|
primitive_color,
|
|
|
|
constant_color,
|
|
|
|
fn_color,
|
|
|
|
assoc_type_color,
|
|
|
|
),
|
2023-01-06 14:18:51 +00:00
|
|
|
block {
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
|
2023-01-06 14:18:51 +00:00
|
|
|
show-text: true
|
2023-07-22 12:01:23 +00:00
|
|
|
|
2023-04-11 17:11:34 +00:00
|
|
|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
2023-01-06 14:18:51 +00:00
|
|
|
reload:
|
|
|
|
assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .trait", {"color": |trait_color|}, ALL)
|
2022-10-19 15:15:11 +00:00
|
|
|
// We need to add `code` here because otherwise it would select the parent too.
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (".item-decl code .struct", {"color": |struct_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .enum", {"color": |enum_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .primitive", {"color": |primitive_color|}, ALL)
|
|
|
|
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (".item-decl .constant", {"color": |constant_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .fn", {"color": |fn_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)
|
|
|
|
},
|
2022-10-19 15:15:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
2023-07-22 12:01:23 +00:00
|
|
|
"attr_color": "#999",
|
|
|
|
"trait_color": "#39afd7",
|
|
|
|
"struct_color": "#ffa0a5",
|
|
|
|
"enum_color": "#ffa0a5",
|
|
|
|
"primitive_color": "#ffa0a5",
|
|
|
|
"constant_color": "#39afd7",
|
|
|
|
"fn_color": "#fdd687",
|
|
|
|
"assoc_type_color": "#39afd7",
|
2022-10-19 15:15:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "dark",
|
2023-07-22 12:01:23 +00:00
|
|
|
"attr_color": "#999",
|
|
|
|
"trait_color": "#b78cf2",
|
|
|
|
"struct_color": "#2dbfb8",
|
|
|
|
"enum_color": "#2dbfb8",
|
|
|
|
"primitive_color": "#2dbfb8",
|
|
|
|
"constant_color": "#d2991d",
|
|
|
|
"fn_color": "#2bab63",
|
|
|
|
"assoc_type_color": "#d2991d",
|
2022-10-19 15:15:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "light",
|
2023-07-22 12:01:23 +00:00
|
|
|
"attr_color": "#999",
|
|
|
|
"trait_color": "#6e4fc9",
|
|
|
|
"struct_color": "#ad378a",
|
|
|
|
"enum_color": "#ad378a",
|
|
|
|
"primitive_color": "#ad378a",
|
|
|
|
"constant_color": "#3873ad",
|
|
|
|
"fn_color": "#ad7c37",
|
|
|
|
"assoc_type_color": "#3873ad",
|
2022-10-19 15:15:11 +00:00
|
|
|
},
|
|
|
|
)
|