Skip to content

Commit b8264a8

Browse files
Add test for keyword/primitive text color
1 parent 168b4d4 commit b8264a8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/test/rustdoc-gui/search-result-color.goml

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ wait-for: "#titles"
1313
assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(197, 197, 197)"})
1414
assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 150, 207)"})
1515

16+
// Checking the color for "keyword".
17+
assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(120, 135, 151)"})
18+
1619
// Dark theme
1720
local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
1821
reload:
@@ -22,6 +25,9 @@ wait-for: "#titles"
2225
assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(221, 221, 221)"})
2326
assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(221, 221, 221)"})
2427

28+
// Checking the color for "keyword".
29+
assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(221, 221, 221)"})
30+
2531
// Light theme
2632
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
2733
reload:
@@ -30,3 +36,6 @@ reload:
3036
wait-for: "#titles"
3137
assert-css: ("//*[@class='desc']//*[text()='Just a normal struct.']", {"color": "rgb(0, 0, 0)"})
3238
assert-css: ("//*[@class='result-name']/*[text()='test_docs::']", {"color": "rgb(0, 0, 0)"})
39+
40+
// Checking the color for "keyword".
41+
assert-css: ("//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(0, 0, 0)"})

src/test/rustdoc-gui/src/test_docs/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub enum AnEnum {
101101
}
102102

103103
#[doc(keyword = "CookieMonster")]
104+
/// Some keyword.
104105
pub mod keyword {}
105106

106107
/// Just some type alias.

0 commit comments

Comments
 (0)