]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-gui/font-weight.goml
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / rustdoc-gui / font-weight.goml
CommitLineData
136023e0 1// This test checks that the font weight is correctly applied.
5099ac24 2goto: file://|DOC_PATH|/lib2/struct.Foo.html
3c0e092e 3assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
a2a8927a
XL
4assert-css: (
5 "//*[@class='structfield small-section-header']//a[text()='Alias']",
6 {"font-weight": "400"},
7)
136023e0
XL
8assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})
9assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"})
10assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"})
11
12goto: file://|DOC_PATH|/test_docs/type.SomeType.html
13assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
14
15goto: file://|DOC_PATH|/test_docs/struct.Foo.html
16assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)
17
18goto: file://|DOC_PATH|/lib2/trait.Trait.html
94222f64
XL
19
20// This is a complex selector, so here's how it works:
21//
3c0e092e 22// * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl
94222f64
XL
23// * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
24// * /code — selects immediate child with tag code
25// * /a[@class='constant'] — selects immediate child with tag a and class constant
26// * //text() — selects child that is text node
27// * /parent::* — selects immediate parent of the text node (the * means it can be any tag)
28//
29// This uses '/parent::*' as a proxy for the style of the text node.
30// We can't just select the '<a>' because intermediate tags could be added.
a2a8927a
XL
31assert-count: (
32 "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
33 1,
34)
35assert-css: (
36 "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
37 {"font-weight": "400"},
38)
94222f64 39
a2a8927a
XL
40assert-count: (".methods .associatedtype", 1)
41assert-css: (".methods .associatedtype", {"font-weight": "600"})
136023e0
XL
42assert-count: (".methods .constant", 1)
43assert-css: (".methods .constant", {"font-weight": "600"})
44assert-css: (".methods .method", {"font-weight": "600"})