Skip to content

Commit 47a1f67

Browse files
authored
Rollup merge of #90048 - GuillaumeGomez:line-number-setting, r=jsha
Add test for line-number setting The first commit updates the version of the package to be able to have multi-line commands (which looks much nicer for this test). r? ````@jsha````
2 parents 632f06d + 457f578 commit 47a1f67

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
7272
# https://github.com/puppeteer/puppeteer/issues/375
7373
#
7474
# We also specify the version in case we need to update it to go around cache limitations.
75-
RUN npm install -g [email protected].3 --unsafe-perm=true
75+
RUN npm install -g [email protected].5 --unsafe-perm=true
7676

7777
ENV RUST_CONFIGURE_ARGS \
7878
--build=x86_64-unknown-linux-gnu \
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Checks that the setting "line numbers" is working as expected.
2+
goto: file://|DOC_PATH|/test_docs/fn.foo.html
3+
4+
// We check that without this setting, there is no line number displayed.
5+
assert-false: "pre.line-number"
6+
7+
// We now set the setting to show the line numbers on code examples.
8+
local-storage: {"rustdoc-line-numbers": "true" }
9+
// We reload to make the line numbers appear.
10+
reload:
11+
12+
// We wait for them to be added into the DOM by the JS...
13+
wait-for: "pre.line-number"
14+
// If the test didn't fail, it means that it was found!
15+
// Let's now check some CSS properties...
16+
assert-css: ("pre.line-number", {
17+
"margin": "0px",
18+
"padding": "13px 8px",
19+
"text-align": "right"
20+
})
21+
// The first code block has two lines so let's check its `<pre>` elements lists both of them.
22+
assert-text: ("pre.line-number", "1\n2")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::fmt;
1212
///
1313
/// ```
1414
/// println!("nothing fancy");
15+
/// println!("but with two lines!");
1516
/// ```
1617
///
1718
/// A failing to compile one:

0 commit comments

Comments
 (0)