Skip to content

Commit 77b307f

Browse files
authored
Rollup merge of #112613 - GuillaumeGomez:fix-gui-test-windows, r=notriddle
Fix rustdoc-gui tests on Windows The browser-ui-test update contains fixes needed for backslash handling (they were not correctly escaped). Since we have a mix of slash and backslash in some tests, I replaced `DOC_FOLDER` variable backslashes with slashes. And finally it seemed like the unicode escaped wasn't much appreciated on Windows for some reason so I used the character directly. cc `@klensy` r? `@notriddle`
2 parents 41d5aec + fced638 commit 77b307f

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.6
1+
0.16.7

src/tools/rustdoc-gui/tester.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ async function main(argv) {
201201
try {
202202
// This is more convenient that setting fields one by one.
203203
const args = [
204-
"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",
205-
"--allow-file-access-from-files",
204+
"--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"),
205+
"--enable-fail-on-js-error", "--allow-file-access-from-files",
206206
];
207207
if (opts["debug"]) {
208208
debug = true;

tests/rustdoc-gui/shortcuts.goml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ press-key: "Escape"
1313
assert-css: ("#help-button .popover", {"display": "none"})
1414
// Checking doc collapse and expand.
1515
// It should be displaying a "-":
16-
assert-text: ("#toggle-all-docs", "[\u2212]")
16+
assert-text: ("#toggle-all-docs", "[]")
1717
press-key: "-"
1818
wait-for-text: ("#toggle-all-docs", "[+]")
1919
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
@@ -23,9 +23,9 @@ assert-text: ("#toggle-all-docs", "[+]")
2323
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
2424
// Expanding now.
2525
press-key: "+"
26-
wait-for-text: ("#toggle-all-docs", "[\u2212]")
26+
wait-for-text: ("#toggle-all-docs", "[]")
2727
assert-attribute: ("#toggle-all-docs", {"class": ""})
2828
// Pressing it again shouldn't do anything.
2929
press-key: "+"
30-
assert-text: ("#toggle-all-docs", "[\u2212]")
30+
assert-text: ("#toggle-all-docs", "[]")
3131
assert-attribute: ("#toggle-all-docs", {"class": ""})

tests/rustdoc-gui/source-code-page.goml

+12-12
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ call-function: ("check-colors", {
6464
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
6565
// Check the `href` property so that users can treat anchors as links.
6666
assert-property: (".src-line-numbers > a:nth-child(1)", {
67-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
68-
})
67+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
68+
}, ENDS_WITH)
6969
assert-property: (".src-line-numbers > a:nth-child(2)", {
70-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#2"
71-
})
70+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#2"
71+
}, ENDS_WITH)
7272
assert-property: (".src-line-numbers > a:nth-child(3)", {
73-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#3"
74-
})
73+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#3"
74+
}, ENDS_WITH)
7575
assert-property: (".src-line-numbers > a:nth-child(4)", {
76-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4"
77-
})
76+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#4"
77+
}, ENDS_WITH)
7878
assert-property: (".src-line-numbers > a:nth-child(5)", {
79-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#5"
80-
})
79+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#5"
80+
}, ENDS_WITH)
8181
assert-property: (".src-line-numbers > a:nth-child(6)", {
82-
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#6"
83-
})
82+
"href": |DOC_PATH| + "/src/test_docs/lib.rs.html#6"
83+
}, ENDS_WITH)
8484

8585
// Assert that the line numbers text is aligned to the right.
8686
assert-css: (".src-line-numbers", {"text-align": "right"})

0 commit comments

Comments
 (0)