Skip to content

Commit 7220f4a

Browse files
Extend GUI test to check colors for all srclink elements
1 parent 29ac48d commit 7220f4a

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

src/test/rustdoc-gui/anchors.goml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This test is to ensure that the anchors (`§`) have the expected color and position.
2-
goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
2+
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
33
show-text: true
44

55
// This is needed to ensure that the text color is computed.
@@ -13,10 +13,31 @@ reload:
1313
assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"})
1414
assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"})
1515
assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 55, 138)"})
16-
assert-css: (".srclink", {"color": "rgb(56, 115, 173)"})
16+
assert-css: (
17+
".rightside .srclink",
18+
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
19+
ALL,
20+
)
21+
compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"])
22+
compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"])
1723

1824
move-cursor-to: ".main-heading .srclink"
19-
assert-css: (".srclink", {"text-decoration": "underline solid rgb(56, 115, 173)"})
25+
assert-css: (
26+
".main-heading .srclink",
27+
{"color": "rgb(56, 115, 173)", "text-decoration": "underline solid rgb(56, 115, 173)"},
28+
)
29+
move-cursor-to: ".impl-items .rightside .srclink"
30+
assert-css: (
31+
".impl-items .rightside .srclink",
32+
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
33+
)
34+
move-cursor-to: ".impl-items .rightside.srclink"
35+
assert-css: (
36+
".impl-items .rightside.srclink",
37+
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
38+
)
39+
40+
goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
2041

2142
assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})
2243

src/test/rustdoc-gui/headings.goml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ assert-css: (
247247

248248
local-storage: {"rustdoc-theme": "light"}
249249
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
250-
assert-css: (".since", {"color": "rgb(128, 128, 128)"})
250+
assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL)
251251

252252
local-storage: {"rustdoc-theme": "dark"}
253253
reload:
254-
assert-css: (".since", {"color": "rgb(128, 128, 128)"})
254+
assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL)
255255

256256
local-storage: {"rustdoc-theme": "ayu"}
257257
reload:
258-
assert-css: (".since", {"color": "rgb(128, 128, 128)"})
258+
assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL)

src/test/rustdoc-gui/src/staged_api/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ edition = "2021"
77
path = "lib.rs"
88

99
[features]
10-
default = ["some_feature"]
10+
default = ["some_feature", "some_other_feature"]
1111
some_feature = []
12+
some_other_feature = []

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ pub struct Foo {}
77
impl Foo {
88
#[stable(feature = "some_feature", since = "1.3.5")]
99
pub fn bar() {}
10+
#[stable(feature = "some_other_feature", since = "1.3.6")]
11+
pub fn yo() {}
1012
}

0 commit comments

Comments
 (0)