]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/item-decl-colors.goml
Rollup merge of #105814 - JakobDegen:custom-mir-terms, r=oli-obk
[rust.git] / src / test / rustdoc-gui / item-decl-colors.goml
1 // This test ensures that the color of the items in the type decl are working as expected.
2
3 // We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
4 // doesn't exist.
5 fail-on-request-error: false
6
7 define-function: (
8     "check-colors",
9     (
10         theme,
11         attr_color,
12         trait_color,
13         struct_color,
14         enum_color,
15         primitive_color,
16         constant_color,
17         fn_color,
18         assoc_type_color,
19     ),
20     [
21         ("goto", "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"),
22         ("show-text", true),
23         ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
24         ("reload"),
25         ("assert-css", (".item-decl .code-attribute", {"color": |attr_color|}, ALL)),
26         ("assert-css", (".item-decl .trait", {"color": |trait_color|}, ALL)),
27         // We need to add `code` here because otherwise it would select the parent too.
28         ("assert-css", (".item-decl code .struct", {"color": |struct_color|}, ALL)),
29         ("assert-css", (".item-decl .enum", {"color": |enum_color|}, ALL)),
30         ("assert-css", (".item-decl .primitive", {"color": |primitive_color|}, ALL)),
31         ("goto", "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"),
32         ("assert-css", (".item-decl .constant", {"color": |constant_color|}, ALL)),
33         ("assert-css", (".item-decl .fn", {"color": |fn_color|}, ALL)),
34         ("assert-css", (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)),
35     ],
36 )
37
38 call-function: (
39     "check-colors",
40     {
41         "theme": "ayu",
42         "attr_color": "rgb(153, 153, 153)",
43         "trait_color": "rgb(57, 175, 215)",
44         "struct_color": "rgb(255, 160, 165)",
45         "enum_color": "rgb(255, 160, 165)",
46         "primitive_color": "rgb(255, 160, 165)",
47         "constant_color": "rgb(57, 175, 215)",
48         "fn_color": "rgb(253, 214, 135)",
49         "assoc_type_color": "rgb(57, 175, 215)",
50     },
51 )
52 call-function: (
53     "check-colors",
54     {
55         "theme": "dark",
56         "attr_color": "rgb(153, 153, 153)",
57         "trait_color": "rgb(183, 140, 242)",
58         "struct_color": "rgb(45, 191, 184)",
59         "enum_color": "rgb(45, 191, 184)",
60         "primitive_color": "rgb(45, 191, 184)",
61         "constant_color": "rgb(210, 153, 29)",
62         "fn_color": "rgb(43, 171, 99)",
63         "assoc_type_color": "rgb(210, 153, 29)",
64     },
65 )
66 call-function: (
67     "check-colors",
68     {
69         "theme": "light",
70         "attr_color": "rgb(153, 153, 153)",
71         "trait_color": "rgb(110, 79, 201)",
72         "struct_color": "rgb(173, 55, 138)",
73         "enum_color": "rgb(173, 55, 138)",
74         "primitive_color": "rgb(173, 55, 138)",
75         "constant_color": "rgb(56, 115, 173)",
76         "fn_color": "rgb(173, 124, 55)",
77         "assoc_type_color": "rgb(56, 115, 173)",
78     },
79 )