[rustdoc] Wrap code blocks in <code> tag
This commit is contained in:
parent
0035d9dcec
commit
ccd550ee56
6 changed files with 318 additions and 270 deletions
20
src/test/rustdoc-gui/code-tags.goml
Normal file
20
src/test/rustdoc-gui/code-tags.goml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
|
||||
goto: file://|DOC_PATH|/test_docs/fn.foo.html
|
||||
size: (1080, 600)
|
||||
// There should be three doc codeblocks
|
||||
// Check that their content is inside <pre><code>
|
||||
assert-count: (".example-wrap pre > code", 3)
|
||||
// Check that function signature is inside <pre><code>
|
||||
assert: "pre.rust.fn > code"
|
||||
|
||||
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
|
||||
assert: "pre.rust.struct > code"
|
||||
|
||||
goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html
|
||||
assert: "pre.rust.enum > code"
|
||||
|
||||
goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
|
||||
assert: "pre.rust.trait > code"
|
||||
|
||||
goto: file://|DOC_PATH|/test_docs/type.SomeType.html
|
||||
assert: "pre.rust.typedef > code"
|
||||
|
|
@ -12,4 +12,4 @@ assert-attribute: (".line-numbers > span:nth-child(5)", {"class": "line-highligh
|
|||
assert-attribute: (".line-numbers > span:nth-child(6)", {"class": "line-highlighted"})
|
||||
assert-attribute-false: (".line-numbers > span:nth-child(7)", {"class": "line-highlighted"})
|
||||
// This is to ensure that the content is correctly align with the line numbers.
|
||||
compare-elements-position: ("//*[@id='1']", ".rust > span", ("y"))
|
||||
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue