fork/rust

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

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

master
2.1 KiB41 linesraw
1// The goal of this test is to check that the external trait implementors, generated with JS,
2// have the same display than the "local" ones.
3go-to: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
4assert: "#implementors-list"
5// There are supposed to be two implementors listed.
6assert-count: ("#implementors-list .impl", 2)
7// Now we check that both implementors have an anchor, an ID and a similar DOM.
8assert: ("#implementors-list .impl:nth-child(1) > a.anchor")
9assert-attribute: ("#implementors-list .impl:nth-child(1)", {"id": "impl-Whatever-for-Struct"})
10assert-attribute: ("#implementors-list .impl:nth-child(1) > a.anchor", {"href": "#impl-Whatever-for-Struct"})
11assert: "#implementors-list .impl:nth-child(1) > .code-header"
12
13assert: ("#implementors-list .impl:nth-child(2) > a.anchor")
14assert-attribute: ("#implementors-list .impl:nth-child(2)", {"id": "impl-Whatever-1"})
15assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
16assert: "#implementors-list .impl:nth-child(2) > .code-header"
17
18go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html"
19compare-elements-position-near-false: (
20    "#impl-EmptyTrait1-for-HasEmptyTraits",
21    "#impl-EmptyTrait2-for-HasEmptyTraits",
22    {"y": 34},
23)
24compare-elements-position-near: (
25    "#impl-EmptyTrait3-for-HasEmptyTraits h3",
26    "#impl-EmptyTrait3-for-HasEmptyTraits .item-info",
27    {"y": 34},
28)
29
30// Now check that re-exports work correctly.
31// There should be exactly one impl shown on both of these pages.
32go-to: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
33assert-count: ("#implementors-list .impl", 1)
34go-to: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
35assert-count: ("#implementors-list .impl", 1)
36
37// Now check that the link is properly rewritten for a crate called `http`.
38// An older version of rustdoc had a buggy check for absolute links.
39go-to: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html"
40assert-count: ("#implementors-list .impl", 1)
41assert-attribute: ("#implementors-list .impl a.trait", {"href": "../http/trait.HttpTrait.html"})