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