Skip to content

Commit 7a09a68

Browse files
Update rustdoc tests and add more checks for type kind colors
1 parent 741d210 commit 7a09a68

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

tests/rustdoc-gui/search-reexport.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ assert-attribute: (
1414
"//a[@class='result-import']",
1515
{"href": "../test_docs/index.html#reexport.TheStdReexport"},
1616
)
17-
assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport")
17+
assert-text: ("//a[@class='result-import']", "test_docs::TheStdReexport (re-export)")
1818
click: "//a[@class='result-import']"
1919
// We check that it has the background modified thanks to the focus.
2020
wait-for-css: ("//*[@id='reexport.TheStdReexport']", {"background-color": "rgb(73, 74, 61)"})

tests/rustdoc-gui/search-result-color.goml

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ define-function: (
55
(result_kind, color, hover_color),
66
block {
77
assert-css: (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL)
8+
assert-css: (".result-" + |result_kind| + " i", {"color": |default_color|})
89
assert-css: (
910
".result-" + |result_kind|,
1011
{"color": |entry_color|, "background-color": |background_color|},
@@ -18,6 +19,7 @@ define-function: (
1819
".result-" + |result_kind| + ":hover ." + |result_kind|,
1920
{"color": |hover_color|},
2021
)
22+
assert-css: (".result-" + |result_kind| + ":hover i", {"color": |default_color|})
2123
move-cursor-to: ".search-input"
2224
focus: ".result-" + |result_kind|
2325
assert-css: (
@@ -65,10 +67,12 @@ assert-css: (
6567
{"border-bottom-color": "#aaa3"}
6668
)
6769

70+
store-value: (default_color, "rgb(197, 197, 197)")
71+
6872
// Checking the color of "keyword" text.
6973
assert-css: (
7074
"//*[@class='result-name']//*[text()='(keyword)']",
71-
{"color": "#788797"},
75+
{"color": |default_color|},
7276
)
7377

7478
store-value: (entry_color, "#0096cf") // color of the search entry
@@ -182,10 +186,12 @@ assert-css: (
182186
{"border-bottom-color": "#aaa3"}
183187
)
184188

189+
store-value: (default_color, "rgb(221, 221, 221)")
190+
185191
// Checking the color for "keyword" text.
186192
assert-css: (
187193
"//*[@class='result-name']//*[text()='(keyword)']",
188-
{"color": "#ddd"},
194+
{"color": |default_color|},
189195
)
190196

191197
store-value: (entry_color, "#ddd") // color of the search entry
@@ -284,10 +290,12 @@ assert-css: (
284290
{"border-bottom-color": "#aaa3"}
285291
)
286292

293+
store-value: (default_color, "rgb(0, 0, 0)")
294+
287295
// Checking the color for "keyword" text.
288296
assert-css: (
289297
"//*[@class='result-name']//*[text()='(keyword)']",
290-
{"color": "#000"},
298+
{"color": |default_color|},
291299
)
292300

293301
store-value: (entry_color, "#000") // color of the search entry

tests/rustdoc-gui/search-result-keyword.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ wait-for: "#search-tabs"
99
// less good.
1010
//
1111
// Checking that the CSS is displaying " (keyword)" in italic.
12-
assert-text: (".result-name span.keyword > i", "(keyword)")
13-
assert-text: (".result-name span.keyword", "CookieMonster (keyword)")
12+
assert-text: (".result-keyword span.keyword + i", "(keyword)")
13+
assert-text: (".result-keyword .result-name", "CookieMonster (keyword)")

0 commit comments

Comments
 (0)