2021-08-28 04:43:55 -05:00
|
|
|
// 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.
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
|
2021-08-28 04:43:55 -05:00
|
|
|
// If the text isn't displayed, the browser doesn't compute color style correctly...
|
|
|
|
show-text: true
|
|
|
|
|
2022-10-18 08:18:45 -05:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
2024-04-01 14:11:22 -05:00
|
|
|
[theme, doc_code_color, doc_inline_code_color],
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
2023-01-06 08:18:51 -06:00
|
|
|
assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
|
|
|
|
assert-css: (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)
|
|
|
|
},
|
2022-10-18 08:18:45 -05:00
|
|
|
)
|
2021-08-28 04:43:55 -05:00
|
|
|
|
2023-09-03 05:46:56 -05:00
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "ayu",
|
2023-09-03 05:49:22 -05:00
|
|
|
"doc_code_color": "#e6e1cf",
|
|
|
|
"doc_inline_code_color": "#ffb454",
|
2023-09-03 05:46:56 -05:00
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "dark",
|
2023-09-03 05:49:22 -05:00
|
|
|
"doc_code_color": "#ddd",
|
|
|
|
"doc_inline_code_color": "#ddd",
|
2023-09-03 05:46:56 -05:00
|
|
|
})
|
|
|
|
call-function: ("check-colors", {
|
|
|
|
"theme": "light",
|
2023-09-03 05:49:22 -05:00
|
|
|
"doc_code_color": "black",
|
|
|
|
"doc_inline_code_color": "black",
|
2023-09-03 05:46:56 -05:00
|
|
|
})
|