fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.9 KiB98 linesraw
1// This test checks links colors.
2go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
3
4// This is needed so that the text color is computed.
5show-text: true
6
7define-function: (
8    "check-colors",
9    (theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
10     sidebar, sidebar_current, sidebar_current_background),
11    block {
12        set-local-storage: {
13            "rustdoc-theme": |theme|,
14            "rustdoc-use-system-theme": "false",
15        }
16        reload:
17        // Checking results colors.
18        assert-css: (".item-table .mod", {"color": |mod|}, ALL)
19        assert-css: (".item-table .macro", {"color": |macro|}, ALL)
20        assert-css: (".item-table .struct", {"color": |struct|}, ALL)
21        assert-css: (".item-table .enum", {"color": |enum|}, ALL)
22        assert-css: (".item-table .trait", {"color": |trait|}, ALL)
23        assert-css: (".item-table .fn", {"color": |fn|}, ALL)
24        assert-css: (".item-table .type", {"color": |type|}, ALL)
25        assert-css: (".item-table .union", {"color": |union|}, ALL)
26        assert-css: (".item-table .keyword", {"color": |keyword|}, ALL)
27        // Checking sidebar elements.
28        assert-css: (
29            ".sidebar-elems a:not(.current)",
30            {"color": |sidebar|, "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
31            ALL,
32        )
33        assert-css: (
34            ".sidebar-elems a.current",
35            {
36                "color": |sidebar_current|,
37                "background-color": |sidebar_current_background|,
38                "font-weight": "500",
39            },
40            ALL,
41        )
42    },
43)
44
45call-function: (
46    "check-colors",
47    {
48        "theme": "ayu",
49        "mod": "#39afd7",
50        "macro": "#a37acc",
51        "struct": "#ffa0a5",
52        "enum": "#ffa0a5",
53        "trait": "#39afd7",
54        "fn": "#fdd687",
55        "type": "#ffa0a5",
56        "union": "#ffa0a5",
57        "keyword": "#39afd7",
58        "sidebar": "#53b1db",
59        "sidebar_current": "#ffb44c",
60        "sidebar_current_background": "transparent",
61    },
62)
63call-function: (
64    "check-colors",
65    {
66        "theme": "dark",
67        "mod": "#d2991d",
68        "macro": "#09bd00",
69        "struct": "#2dbfb8",
70        "enum": "#2dbfb8",
71        "trait": "#b78cf2",
72        "fn": "#2bab63",
73        "type": "#2dbfb8",
74        "union": "#2dbfb8",
75        "keyword": "#d2991d",
76        "sidebar": "#fdbf35",
77        "sidebar_current": "#fdbf35",
78        "sidebar_current_background": "#444",
79    },
80)
81call-function: (
82    "check-colors",
83    {
84        "theme": "light",
85        "mod": "#3873ad",
86        "macro": "#068000",
87        "struct": "#ad378a",
88        "enum": "#ad378a",
89        "trait": "#6e4fc9",
90        "fn": "#ad7c37",
91        "type": "#ad378a",
92        "union": "#ad378a",
93        "keyword": "#3873ad",
94        "sidebar": "#356da4",
95        "sidebar_current": "#356da4",
96        "sidebar_current_background": "#fff",
97    },
98)