]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/highlight-colors.goml
Rollup merge of #107777 - compiler-errors:derive_const-actually-derive-const, r=fee1...
[rust.git] / tests / rustdoc-gui / highlight-colors.goml
1 // This test checks the highlight colors in the source code pages.
2 goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
3 show-text: true
4
5 define-function: (
6     "check-colors",
7     (
8         theme,
9         kw,
10         kw2,
11         prelude_ty,
12         prelude_val,
13         lifetime,
14         number,
15         string,
16         bool_val,
17         self,
18         attr,
19         macro,
20         question_mark,
21         comment,
22         doc_comment,
23     ),
24     block {
25         local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
26         reload:
27         assert-css: ("pre.rust .kw", {"color": |kw|}, ALL)
28         assert-css: ("pre.rust .kw-2", {"color": |kw2|}, ALL)
29         assert-css: ("pre.rust .prelude-ty", {"color": |prelude_ty|}, ALL)
30         assert-css: ("pre.rust .prelude-val", {"color": |prelude_val|}, ALL)
31         assert-css: ("pre.rust .lifetime", {"color": |lifetime|}, ALL)
32         assert-css: ("pre.rust .number", {"color": |number|}, ALL)
33         assert-css: ("pre.rust .string", {"color": |string|}, ALL)
34         assert-css: ("pre.rust .bool-val", {"color": |bool_val|}, ALL)
35         assert-css: ("pre.rust .self", {"color": |self|}, ALL)
36         assert-css: ("pre.rust .attr", {"color": |attr|}, ALL)
37         assert-css: ("pre.rust .macro", {"color": |macro|}, ALL)
38         assert-css: ("pre.rust .question-mark", {"color": |question_mark|}, ALL)
39         assert-css: ("pre.rust .comment", {"color": |comment|}, ALL)
40         assert-css: ("pre.rust .doccomment", {"color": |doc_comment|}, ALL)
41     },
42 )
43
44 call-function: ("check-colors", {
45     "theme": "ayu",
46     "kw": "rgb(255, 119, 51)",
47     "kw2": "rgb(255, 119, 51)",
48     "prelude_ty": "rgb(105, 242, 223)",
49     "prelude_val": "rgb(255, 119, 51)",
50     "lifetime": "rgb(255, 119, 51)",
51     "number": "rgb(184, 204, 82)",
52     "string": "rgb(184, 204, 82)",
53     "bool_val": "rgb(255, 119, 51)",
54     "self": "rgb(54, 163, 217)",
55     "attr": "rgb(230, 225, 207)",
56     "macro": "rgb(163, 122, 204)",
57     "question_mark": "rgb(255, 144, 17)",
58     "comment": "rgb(120, 135, 151)",
59     "doc_comment": "rgb(161, 172, 136)",
60 })
61 call-function: ("check-colors", {
62     "theme": "dark",
63     "kw": "rgb(171, 138, 193)",
64     "kw2": "rgb(118, 154, 203)",
65     "prelude_ty": "rgb(118, 154, 203)",
66     "prelude_val": "rgb(238, 104, 104)",
67     "lifetime": "rgb(217, 127, 38)",
68     "number": "rgb(131, 163, 0)",
69     "string": "rgb(131, 163, 0)",
70     "bool_val": "rgb(238, 104, 104)",
71     "self": "rgb(238, 104, 104)",
72     "attr": "rgb(238, 104, 104)",
73     "macro": "rgb(62, 153, 159)",
74     "question_mark": "rgb(255, 144, 17)",
75     "comment": "rgb(141, 141, 139)",
76     "doc_comment": "rgb(140, 163, 117)",
77 })
78 call-function: ("check-colors", {
79     "theme": "light",
80     "kw": "rgb(137, 89, 168)",
81     "kw2": "rgb(66, 113, 174)",
82     "prelude_ty": "rgb(66, 113, 174)",
83     "prelude_val": "rgb(200, 40, 41)",
84     "lifetime": "rgb(183, 101, 20)",
85     "number": "rgb(113, 140, 0)",
86     "string": "rgb(113, 140, 0)",
87     "bool_val": "rgb(200, 40, 41)",
88     "self": "rgb(200, 40, 41)",
89     "attr": "rgb(200, 40, 41)",
90     "macro": "rgb(62, 153, 159)",
91     "question_mark": "rgb(255, 144, 17)",
92     "comment": "rgb(142, 144, 140)",
93     "doc_comment": "rgb(77, 77, 76)",
94 })