fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB43 linesraw
1// This test checks that the font weight is correctly applied.
2go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
3assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"})
4assert-css: (
5    "//*[@class='structfield small-section-header']//a[text()='Alias']",
6    {"font-weight": "400"},
7)
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
12go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
13assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
14
15go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
16assert-css: (".impl-items .method > .code-header", {"font-weight": "600"}, ALL)
17
18go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
19
20// This is a complex selector, so here's how it works:
21//
22// * //pre[@class='rust item-decl'] — selects item-decl code block
23// * /code — selects immediate child with tag code
24// * /a[@class='constant'] — selects immediate child with tag a and class constant
25// * //text() — selects child that is text node
26// * /parent::* — selects immediate parent of the text node (the * means it can be any tag)
27//
28// This uses '/parent::*' as a proxy for the style of the text node.
29// We can't just select the '<a>' because intermediate tags could be added.
30assert-count: (
31    "//pre[@class='rust item-decl']/code/a[@class='constant']//text()/parent::*",
32    1,
33)
34assert-css: (
35    "//pre[@class='rust item-decl']/code/a[@class='constant']//text()/parent::*",
36    {"font-weight": "400"},
37)
38
39assert-count: (".methods .associatedtype", 1)
40assert-css: (".methods .associatedtype", {"font-weight": "600"})
41assert-count: (".methods .constant", 1)
42assert-css: (".methods .constant", {"font-weight": "600"})
43assert-css: (".methods .method > .code-header", {"font-weight": "600"})