File: code-color.goml

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (34 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to
// check that the rule isn't applied on other "<code>" elements.
//
// While we're at it, we also check it for the other themes.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true

define-function: (
    "check-colors",
    [theme, doc_code_color, doc_inline_code_color],
    block {
        call-function: ("switch-theme", {"theme": |theme|})
        assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
        assert-css: (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)
    },
)

call-function: ("check-colors", {
    "theme": "ayu",
    "doc_code_color": "#e6e1cf",
    "doc_inline_code_color": "#ffb454",
})
call-function: ("check-colors", {
    "theme": "dark",
    "doc_code_color": "#ddd",
    "doc_inline_code_color": "#ddd",
})
call-function: ("check-colors", {
    "theme": "light",
    "doc_code_color": "black",
    "doc_inline_code_color": "black",
})