]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/sidebar.goml
Auto merge of #90339 - GuillaumeGomez:doc-alias-doc, r=GuillaumeGomez
[rust.git] / src / test / rustdoc-gui / sidebar.goml
1 goto: file://|DOC_PATH|/test_docs/index.html
2 assert-text: (".sidebar > .location", "Crate test_docs")
3 // In modules, we only have one "location" element.
4 assert-count: (".sidebar .location", 1)
5 assert-text: (".sidebar-elems > #all-types", "See all test_docs's items")
6 // We check that we have the crates list and that the "current" on is "test_docs".
7 assert-text: (".sidebar-elems > .crate > ul > li > a.current", "test_docs")
8 // And we're also supposed to have the list of items in the current module.
9 assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
10 assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Macros")
11 assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Structs")
12 assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Enums")
13 assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Traits")
14 assert-text: (".sidebar-elems > .items > ul > li:nth-child(6)", "Functions")
15 assert-text: (".sidebar-elems > .items > ul > li:nth-child(7)", "Type Definitions")
16 assert-text: (".sidebar-elems > .items > ul > li:nth-child(8)", "Unions")
17 assert-text: (".sidebar-elems > .items > ul > li:nth-child(9)", "Keywords")
18 assert-text: ("#structs + .item-table .item-left > a", "Foo")
19 click: "#structs + .item-table .item-left > a"
20
21 // PAGE: struct.Foo.html
22 assert-count: (".sidebar .location", 2)
23 // We check that there is no crate listed outside of the top level.
24 assert-false: ".sidebar-elems > .crate"
25 // We now go back to the crate page to click on the "lib2" crate link.
26 goto: file://|DOC_PATH|/test_docs/index.html
27 click: ".sidebar-elems > .crate > ul > li:first-child > a"
28
29 // PAGE: lib2/index.html
30 goto: file://|DOC_PATH|/lib2/index.html
31 assert-text: (".sidebar > .location", "Crate lib2")
32 // We check that we have the crates list and that the "current" on is now "lib2".
33 assert-text: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
34 // We now go to the "foobar" function page.
35 assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
36 assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
37 assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
38 assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
39 assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
40 assert-text: ("#functions + .item-table .item-left > a", "foobar")
41 click: "#functions + .item-table .item-left > a"
42
43 // PAGE: fn.foobar.html
44 // In items containing no items (like functions or constants) and in modules, we have one
45 // "location" elements.
46 assert-count: (".sidebar .location", 1)
47 // There is a "<br>" tag between "in" and "lib2", but it doesn't count as a space.
48 assert-text: (".sidebar .sidebar-elems .location", "Other items inlib2")
49 // We check that we don't have the crate list.
50 assert-false: ".sidebar-elems > .crate"
51
52 goto: ./module/index.html
53 assert-text: (".sidebar > .location", "Module module")
54 // We check that we don't have the crate list.
55 assert-false: ".sidebar-elems > .crate"
56
57 goto: ./sub_module/sub_sub_module/index.html
58 assert-text: (".sidebar > .location", "Module sub_sub_module")
59 // We check that we don't have the crate list.
60 assert-false: ".sidebar-elems > .crate"
61 assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Functions")
62 assert-text: ("#functions + .item-table .item-left > a", "foo")