2022-10-19 10:15:11 -05:00
|
|
|
// This test ensures that the color of the items in the type decl are working as expected.
|
2022-11-09 10:00:05 -06:00
|
|
|
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
|
|
|
|
2023-10-05 20:44:40 -05:00
|
|
|
// We need to disable this check because `trait.impl/test_docs/trait.TraitWithoutGenerics.js`
|
2022-11-09 10:00:05 -06:00
|
|
|
// doesn't exist.
|
|
|
|
fail-on-request-error: false
|
|
|
|
|
2022-10-19 10:15:11 -05:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
2024-04-01 14:11:22 -05:00
|
|
|
[
|
2022-10-19 10:15:11 -05:00
|
|
|
theme,
|
|
|
|
attr_color,
|
|
|
|
trait_color,
|
|
|
|
struct_color,
|
|
|
|
enum_color,
|
|
|
|
primitive_color,
|
|
|
|
constant_color,
|
|
|
|
fn_color,
|
|
|
|
assoc_type_color,
|
2024-04-01 14:11:22 -05:00
|
|
|
],
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
|
2023-01-06 08:18:51 -06:00
|
|
|
show-text: true
|
2023-07-22 07:01:23 -05:00
|
|
|
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
|
|
|
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL)
|
|
|
|
assert-css: (".item-decl .trait", {"color": |trait_color|}, ALL)
|
2022-10-19 10:15:11 -05:00
|
|
|
// We need to add `code` here because otherwise it would select the parent too.
|
2023-01-06 08:18:51 -06: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 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"
|
2023-01-06 08:18:51 -06: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 10:15:11 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
2023-07-22 07:01:23 -05: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 10:15:11 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "dark",
|
2023-07-22 07:01:23 -05: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 10:15:11 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "light",
|
2023-07-22 07:01:23 -05: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 10:15:11 -05:00
|
|
|
},
|
|
|
|
)
|