Skip to content

Commit 7659ef4

Browse files
committedApr 5, 2024
Use include command to reduce code duplication
·
1.88.01.79.0
1 parent 5958f5e commit 7659ef4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+112
-150
lines changed
 

‎tests/rustdoc-gui/anchors.goml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// This test is to ensure that the anchors (`§`) have the expected color and position.
2+
include: "utils.goml"
23

34
define-function: (
45
"check-colors",
@@ -8,10 +9,7 @@ define-function: (
89
// This is needed to ensure that the text color is computed.
910
show-text: true
1011

11-
// Setting the theme.
12-
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
13-
// We reload the page so the local storage settings are being used.
14-
reload:
12+
call-function: ("switch-theme", {"theme": |theme|})
1513

1614
assert-css: ("#toggle-all-docs", {"color": |main_color|})
1715
assert-css: (".main-heading h1 a:nth-of-type(1)", {"color": |main_heading_color|})

‎tests/rustdoc-gui/code-color.goml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// check that the rule isn't applied on other "<code>" elements.
33
//
44
// While we're at it, we also check it for the other themes.
5+
include: "utils.goml"
56
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
67
// If the text isn't displayed, the browser doesn't compute color style correctly...
78
show-text: true
@@ -10,10 +11,7 @@ define-function: (
1011
"check-colors",
1112
[theme, doc_code_color, doc_inline_code_color],
1213
block {
13-
// Set the theme.
14-
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
15-
// We reload the page so the local storage settings are being used.
16-
reload:
14+
call-function: ("switch-theme", {"theme": |theme|})
1715
assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
1816
assert-css: (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)
1917
},

0 commit comments

Comments
 (0)
Please sign in to comment.