-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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````
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Checks that the setting "line numbers" is working as expected. | ||
goto: file://|DOC_PATH|/test_docs/fn.foo.html | ||
|
||
// We check that without this setting, there is no line number displayed. | ||
assert-false: "pre.line-number" | ||
|
||
// We now set the setting to show the line numbers on code examples. | ||
local-storage: {"rustdoc-line-numbers": "true" } | ||
// We reload to make the line numbers appear. | ||
reload: | ||
|
||
// We wait for them to be added into the DOM by the JS... | ||
wait-for: "pre.line-number" | ||
// If the test didn't fail, it means that it was found! | ||
// Let's now check some CSS properties... | ||
assert-css: ("pre.line-number", { | ||
"margin": "0px", | ||
"padding": "13px 8px", | ||
"text-align": "right" | ||
}) | ||
// The first code block has two lines so let's check its `<pre>` elements lists both of them. | ||
assert-text: ("pre.line-number", "1\n2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters